Passing parameters from Organize Tests to test script
- 6 years ago
I must be honest and say that I don't quite understand how that is not addressed by the initial code I posted. Perhaps you are trying to return the browser as an object from another script call ? In that case, replace
Browsers.Item(browsername,url).Run();
with
return Browsers.Items(browsername,url);
Then in your calling function, rather than
StartBrowser('edge','www.mywebsite.com');
do:
var newBrowser = StartBrowser('edge','www.mywebsite.com');
newBrowser.Run();
- 6 years ago
You can use a function in script with a parameter/mutiple parameters. Create the function in the initial post. Now drag that script unit into your window. All the functions in your script will be added. Remove the ones you don't want, then update the parameters as required - just like setting in in a KWT. Alternatively, add new test item. Click elipses in the test column and select the script. This process looks the same as "Run Script" from within a KWT