Hello,
There is a button on our website that opens a PDF in a new window. In my test case, I have set it up so that the URL for the original window is captured and saved as a variable then the PDF button is clicked/opened. My next step is “Switch to Window URL” with the saved URL variable as the input. However, what actually happens is a rapid switch back and forth between the tab I need to continue the test on and the PDF tab.
The script is below:
WebUI.getUrl()
‘Click Materials’
WebUI.click(findTestObject(‘Clinian Queue/Materials Button’))
‘Focus on the Materials Modal’
WebUI.focus(findTestObject(‘Clinian Queue/Materials Modal’), FailureHandling.STOP_ON_FAILURE)
‘Click Treatment Plan PDF’
WebUI.click(findTestObject(‘Clinian Queue/Treatment Plan PDF’))
‘Delay for PDF loading’
WebUI.waitForPageLoad(2)
‘Switch to original tab’
WebUI.switchToWindowUrl(url)
Let me know what should be changed to make this work.
Thank you,
Lauren