Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Automation Test scripts Execution



I am new to this community. I am trying to integrate our Automation Test scripts written in Selenium with TestRail.

Currently the scripts are run manually by invoking a batch file.

I will like to understand if it is possible to call a batch file from UI scripts. For time being it’s ok even if I can run the batch from my local machine.

I have already added the button in UI, but not sure if this button can call a local batch file.
Tried calling like below from a UI script but no success:

WshShell = new ActiveXObject(“Wscript.Shell”);“E://myTestFolder//test.bat”)

Any suggestion?



Hi Nitin,

Thanks for your post! In general, it would be possible to trigger automated tests via a UI script in TestRail, and you can learn more about this process and see one of our examples on our website here:

That said, this method doesn’t provide very many benefits and we would recommend triggering your automated tests outside of TestRail either manually as you are currently, scheduled or via a continuous integration system. You can then use TestRail’s API to submit the test results to TestRail, and this is the best and recommended approach. Hope this helps!



Thanks Marco.

As I mentioned, I have been able to use UI script for adding button.
I was wondering if this button can trigger a Windows batch file. I am not able to get it work.
Probably not possible and we will have to run it outside. It was just nicer if we could have one stop to trigger and refer everything about Automation Tests, which would be TestRail. The location where the batch is run doesn’t matter for now.

On other side, I do understand that the selenium scripts can be modified to update test cases, and this is good. So the flow coming to testrail is fine.

Hope I did some clarification.



Hi Gurock Team,

I do have same question:[quote=“Nitin, post:3, topic:5442”]
I was wondering if this button can trigger a Windows batch file. I am not able to get it work.

So is there any thing I’m also missing…

Need your shower your thoughts… Thanks in Advance.


Hi All,

Thanks for your feedback! The trigger script can be written in any language and doesn’t need to be a PHP file as mentioned in our documentation, and you would just need to be sure to reference the script/file within the UI script. We haven’t tested this specifically with a Windows batch file, but we’ve had customers use many different script types with success. Hope this helps!



Thank you very much.
I understand the concept you are explained.

But I would be very glad to see UI script example on ‘how to call particular java / vbs file’

Just syntax…


Hi there,

Unfortunately, we do not have pre-written scripts for UI scripts that we can offer. As we point out in our documentation, basic HTML, CSS and JavaScript knowledge is required to write UI Scripts, but it’s possible to learn this while writing your first simple scripts.


Make Sence… :slight_smile:

So let me work in a way like 'using JS how to call certain file from particular location’
Hope this works.

please suggest if I’m in wrong direction



You can use pretty much any language that you want if you are more comfortable with a specific programming language than another.