Forum Discussion
Let's say you have added the test object "SeleniumTests" to your test project. In there, you have your assembly and you've specified your TestFixture. I haven't tried this, but apparently, when you add your test fixture, you do have the option to specific parameters. So, somewhere in there, there's a parameter call to execute the test fixture.
Give this a try. Where your object is called "SeleniumTests" and the NUnit test you've added you've called "TestFixture", will this script code work?
function testAllBrowsers(){
for (var i = 0; i < Browsers.Count; i++) {
SeleniumTests.TestFixture.Execute(Browsers.Item(i).Family);
}
}
Or... perhaps if there are parameters that need to be set you would have to do something like
function testAllBrowsers(){
for (var i = 0; i < Browsers.Count; i++) {
SeleniumTests.TestFixture.BrowserName = Browsers.Item(i).Family;
SeleniumTests.TestFixture.Execute();
}
}
Some things worth exploring, I guess... I haven't done much with the Selenium interfacing but something on these lines probably exists SOMEWHERE.
Thank you so much for your quick response. I am not 100% sure yet where to put that function. I think I need to learn TestComplete itself a bit more.
I did try making a keyword test like this:
Browser Loop: Chrome, Edge
Run Code Snippet: Value = UnitTesting.SeleniumTests.Execute(Browsers.CurrentBrowser)
What this does is launches the browser (Chrome is the first), then it tries to run my test. My web drivers in the test not able to pick up that browser from the loop. I will keep taking a look at this.