How do I change focus to a new popup tab in Selenium?

后端 未结 7 1244
渐次进展
渐次进展 2020-12-29 06:38

I\'m using Selenium and Firefox.

I have a link on a page (say linkA) that opens a new page in a new tab. The new tab is displayed when linkA is clicked. I then w

7条回答
  •  被撕碎了的回忆
    2020-12-29 06:40

    lericain59's sent me in the right direction, though I had to make a few changes for it work with my version of selenium's IDE (I'm running 1.0.6). Also, for my purposes, I didn't need to verify so much that it opened in a separate window, only that it was opening the correct window.

    Here's the script that worked for me.

    • storeEval | this.browserbot.findElement('link=click here').href | myUrl |
    • open | ${myUrl} ||

    this.page() didn't work. It seems to have been replaced with this.browserbot. Also, I just opened the page directly - it avoids a manual pause and has less steps.

提交回复
热议问题