Browser.Page(mypage).close() in edge
Hi,
I experience a strange behaviour in edge executing the following code:
function cleanUpWorld() { var testedBrowser = ProjectSuite.Variables.testedBrowser; var cleanupScriptUrl = ProjectSuite.Variables.BaseURL + "tools/testing_start_apo.php"; // Checks if the currently for test runs used browser is already running. if(! Sys.WaitBrowser(testedBrowser).Exists) { // If the browser is not running, starts it. Browsers.Item(testedBrowser).Run(); } // Opens a new tab. Sys.Browser(testedBrowser).BrowserWindow(0).Keys("^t"); // Opens URL to run the php cleanup script "testing_start_apo.php". Sys.Browser(testedBrowser).ToUrl(cleanupScriptUrl); // Closes the tab in which the url was opened. Sys.Browser(testedBrowser).Page(cleanupScriptUrl).Close(); }
When executing the function in Internet Explorer, everything works just fine. A new tab is opened, in that new tab the page with the correct url is opened, the tab is closed and Internet Explorer stays active.
When executing the function in Edge, when the tab in which the url was opened shall be closed, both the page and the browser are closed, instead of the page only.
When I execute the test operations manually without TestComplete, Edge behaves as it should and stays open.
The following picture shows both test logs, one for a test run with Edge, one for a test run with Internet Explorer:
Both browsers were prepared for testing as described in the Test Complete documentation. When Edge is used in TestComplete options the checkbox is checked for "Enable support for testing Windows Store applications".
Does anyone know why the whole edge browser is closed instead of the page only?