For my test I need to click on one button that will open another tab/window and then work on that new opened page.
I have tried all of the commands like: Switch to Window Index/Title/Url. And none of theme work for me. Test case stopped at this action.
Can you help me or maybe you need some addition description?
It seems strange to me that the Window switching commands donât have a timeout parameter while the Frame switching commands do. A timeout, of course, implies the command will make multiple attempts to switch over a specified period â perfect for things that donât happen âinstantlyâ, like opening new windows/tabs.
So try adding a delay before switching to the new window.
Russ Thomas said:
It seems strange to me that the Window switching commands donât have a timeout parameter while the Frame switching commands do. A timeout, of course, implies the command will make multiple attempts to switch over a specified period â perfect for things that donât happen âinstantlyâ, like opening new windows/tabs.
So try adding a delay before switching to the new window.
I added delay 5 and 30 sec. It didnât help.
Here you can look at part of the script:
WebUI.openBrowser(ââ)
WebUI.maximizeWindow()
WebUI.navigateToUrl(âhttps://www.signatours.dk/â)
WebUI.click(findTestObject(âPage_Rejser med Signatours Vlg mel (5)/div_Okâ))
WebUI.click(findTestObject(âPage_Rejser med Signatours Vlg mel (5)/div_Vlg rejsemlâ))
WebUI.click(findTestObject(âPage_Rejser med Signatours Vlg mel (5)/span_Emiraterneâ))
WebUI.click(findTestObject(âPage_Rejser med Signatours Vlg mel (5)/span_Dubaiâ))
WebUI.click(findTestObject(âPage_Rejser med Signatours Vlg mel (5)/span_Sgâ))
WebUI.click(findTestObject(âPage_Rejser til Dubai SignaTours.d (2)/strong_Ls mereâ))
WebUI.delay(30)
WebUI.switchToWindowTitle(âAmwaj Rotana Jumeirah Beachâ)
WebUI.click(findTestObject(âPage_Amwaj Rotana Jumeirah Beach i/strong_Sg prisâ))
WebUI.click(findTestObject(âPage_Amwaj Rotana Jumeirah Beach i/strong_Bestilâ))
WebUI.closeBrowser()
Test always breaks at switchToWindow step. I tried id â1â and url âAmwaj Rotana Jumeirah Beach i Dubai | Book online nu!â, also.
WebUI.switchToWindowTitle('Amwaj Rotana Jumeirah Beach')
Thatâs not the complete window title:
<title>Amwaj Rotana Jumeirah Beach i Dubai | Book online nu!</title>
Russ Thomas said:
WebUI.switchToWindowTitle('Amwaj Rotana Jumeirah Beach')
Thatâs not the complete window title:
<title>Amwaj Rotana Jumeirah Beach i Dubai | Book online nu!</title>
You are right. But even if I use full title - next action is not working. So, after âswitchToWindowâ step - test breaks.
Looks like active window for me and active window for studio are different.
Yes, were you able to find a solution?
@Oleh_Yevchuk Were you able to find the solution? Even I am not able to switch to window using title. Please let me know how you resolved this issue.