在IE中,将打开新窗口,而不是硒Web驱动程序中的新选项卡

在IE中,将打开新窗口,而不是硒Web驱动程序中的新选项卡

问题描述:

在应用程序中手动单击链接后,它会在Chrome和IE中的新标签页中打开.但是,当我运行脚本时,该链接会在IE中的新窗口中打开,而不是新标签页.相同的脚本可以在Chrome中按预期运行.知道如何摆脱这种情况吗?

When a link is clicked manually in my application, it opens in new tab in Chrome and IE.However when my script is run, the link opens in a new window in IE instead of new tab. Same script runs as expected in Chrome. Any idea how to get rid of this?

更改IE的默认设置.

  1. 打开Internet Explorer,单击工具"图标(或按Ctrl-X),然后单击"Internet选项".

  1. Open Internet Explorer, click the Tools icon (or press Ctrl-X), and then click Internet Options.

在常规"标签中,找到标签"部分,然后单击该部分中的设置"按钮.

In the General tab, find the Tabs section, then click the Settings button within that section.

在设置"对话框的中间,有一个名为当打开新选项卡时,打开:"的选项,并且它下方是一个下拉菜单.

Midway down that Settings dialog, there's an option called "When a new tab is opened, open:"—and a pull-down menu below it.

单击该下拉菜单,然后选择新标签页". (乔尔以某种方式设置为另一个选项:您的第一个主页.")

Click that pull-down, then choose The new tab page. (Joel's somehow got set to another option: "Your first home page.")

单击确定",然后再次单击确定".

Click OK, then OK again.