TestProject Forum
Powered by leading experts in the test automation community

Determine which browser the test is running under?

I created a new test and im storing a screenshot of the page. Is there a way to include the name of the browser inside the screenshot filename? Like is there an exposed variable I can get? I see how to do it with a parameter but i don’t want to have to specify the browser each time i run the test. Can it auto get this info?

*Edit -
I see that if i download the code for the test i can then get access via code to the browser name. But then when i upload i get the error: “No CodedTests were found in assembly.” Is there a trick to getting this site to recognize the code? It runs fine locally.

Now a different error on uploading a modified test. When I deleted all tests under my account even.
“Some of the tests within the package have identical names”

Frustrating.

Hello @ryan
First the error with the duplicate name is because you have coded tests within the package you are trying to upload which have duplicate names.
You can check the code to see where the duplicate names are.

Secondly, Did you generate the code for the openSDK?

OpenSDK:

Or the TestProject V1 SDK?

And third, we will create an addon which returns the browser the test is currently run on ,after that you can use that action, get the name of the browser and use this action to take a screenshot and put the browser name parameter inside the filename
image

We updated the Generic Extensions addon with the action that returns the browser name

Now you can use that output from the action and enter that in the filename of the screenshot you are taking.

Thanks for the reply. The get browser name is mostly what I needed.
I exported the test using Or the TestProject V1 SDK in c# and i can see I’d use that in the future. Does that not work for reimport?

Thanks for the help and the cool product.

*Edit - Nevermine i see i needed to change it inside the

comment section. Thanks alot for the help this will make it 100 * easier going forward.