Is there a way to use watir to open a link in a new tab or window in firefox

I have a web application that I automate using watir. The application has a viewing page that displays thumbnails for a set of templates. Each thumbnail is a link to a template. I need to open each template in a new tab or window, take a screenshot or print the pdf file of the template to make sure that it opens correctly and looks right. Then close this tab or window and return to the template browser to open the next template. I need to do this on firefox / safari chrome and IE mac and windows.

+3
source share
2 answers

Why not open it on the same tab, take a screenshot, and then come back?

I did not use Watir, only Selenium, but it looks like Watir has a method back. If not, you can probably save the URL of the page using thumbnails and then open it at the URL.

+2
source

You can read the URL of the link, save it in a variable, open a new browser window, and then using, ie.goto(url)you can open the link in a new browser.

0
source

Source: https://habr.com/ru/post/1774789/


All Articles