开发者

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

开发者 https://www.devze.com 2023-01-25 14:36 出处:网络
I have a web application I am automating with watir. The application has a browsing page which shows thumbnails for a set of templates. Each thumbnail is开发者_开发问答 a link to the template. I need

I have a web application I am automating with watir. The application has a browsing page which shows thumbnails for a set of templates. Each thumbnail is开发者_开发问答 a link to the template. I need to open each template in a new tab or window and take a screen shot or print a pdf of the template to verify that it opens correctly and looks correct. Then close that 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.


Why not open it in the same tab, take the sreenshot, then go back?

I haven't used Watir, only Selenium, but it looks like Watir has a back method as well. If not, you can probably store the URL of the page with the thumbnails and then open it directly by URL.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消