Opening browser from BeforeFeature hook causes 'Unable to find the object Sys.Browser("*")' error
Hi all,
I have 2 feature files, with multiple scenarios inside them. I am opening the browser using the following function below:
function OpenBrowser() {
Log.AppendFolder("Open browser for the test.") ;
Browsers.Item(btChrome).RunOptions = "--no-first-run";
Browsers.Item(btChrome).Run();
Sys.Browser().BrowserWindow(0).Maximize();
}
I'm calling this function from a BeforeFeature hook, on a remote Windows machine. It seems to cause a 'Unable to find the object Sys.Browser("*")' error for each test. In the video recorded for each, it just seems Chrome doesn't open. However, if I call this function from a BeforeScenario hook, it runs fine.
The above problem doesn't seem to happen when I run the test on my local machine. Do you know why this is happening only on the remote machine?
Thanks!
Hi all,
Just to follow up on this, I found out why this was a problem.
In the Azure Devops Pipeline, the TestCompleteAdapter does NOT support BeforeFeature and AfterFeature hooks. Confirmed by Smartbear themselves.
Thanks again and hope this helps someone else that bumps into this issue.