cancel
Showing results for 
Search instead for 
Did you mean: 

opening a browser in script extension

Community Hero

Re: opening a browser in script extension

Something to suggest.

 

Rather than use a project variable to dictate the conditions of the switch, make that a parameter passed in to the function.  Then, if you still want to use the variable, you can... or, you can just pass in the string.

What I would also do is bullet proof the string.  Wrap the condition of the "switch" with something like aqString.UpperCase and then have all the cases in all upper.  I'd also, suggest that you account for different possible inputs.  "Google Chrome" in addition to chrome... Microsoft Edge instead of just Edge... and, you know... the default works well... but I like to control my tests a little more closely... I'd set the default to log an error and throw an exception if the user enters anything other than the desired values... if not that, at LEAST log a warning like "Unknown browser indicated; Using Microsoft Edge as default" to communicate to your user that they did something wrong.

Just my $0.02... but these are things from experience.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Super Contributor

Re: opening a browser in script extension

All of the above. Haven't gotten there yet. Thanks

New Here?
Join us and watch the welcome video:
Final Interview in the Series
API_testing_mistake#7