通过Selenium WebDriver在浏览器的同一窗口中打开新标签页吗?
问题描述:
如何通过Selenium WebDriver命令在浏览器的同一窗口会话中打开新选项卡?
How to open a new tab in the same window session of the browser through Selenium WebDriver command?
答
可以在同一浏览器窗口中打开新标签页,请参见Firefox解决方案:
Opening a new tab in the same browser window is possible, see solutions for Firefox:
- How to open a new tab using Selenium WebDriver with Java?
- Controlling firefox tabs in selenium
问题是-打开标签页后,没有内置的简便方法可以在标签页之间进行切换.硒只是不提供相应的API .
The problem is - once you've opened a tab, there is no built-in easy way to switch between tabs. Selenium simply doesn't provide an API for that.
打开一个新的浏览器窗口,而不是一个标签.
Instead of a tab, open a new browser window.