windows Internet Explorer 8 64 位和 Selenium 不工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1517623/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 06:48:01  来源:igfitidea点击:

Internet Explorer 8 64bit and Selenium Not working

windowswindows-764-bitselenium

提问by chobo2

I am trying to get selenium tests to run. Yet every time I try to run a tests that should run IE I get a error on line 863 of htmlutils.js It says that I should disable my popup blocker. The thing is I went to IE tools-> turn of popup block.

我正在尝试运行 selenium 测试。然而,每次我尝试运行应该运行 IE 的测试时,我都会在 htmlutils.js 的第 863 行出现错误,它说我应该禁用弹出窗口阻止程序。问题是我去了 IE 工具-> 关闭弹出窗口。

So it is disabled and I get this error.

所以它被禁用,我收到这个错误。

Is there something else I need to disable. I actually don't even know what version of Internet explorer it is running since I am using Windows 7 Pro 64bit version. So when I do use IE I use 64bit version but I am under the understanding if the site or something like that does not support 64bit it goes to 32bit.

还有什么我需要禁用的。由于我使用的是 Windows 7 Pro 64 位版本,因此实际上我什至不知道它正在运行什么版本的 Internet Explorer。因此,当我确实使用 IE 时,我使用 64 位版本,但我了解该站点或类似的东西是否不支持 64 位,它会转到 32 位。

So not sure what I need to do it to make it work.

所以不确定我需要做什么才能使它工作。

This is the lines where it does

这是它所做的行

function openSeparateApplicationWindow(url, suppressMozillaWarning) {
    // resize the Selenium window itself
    window.resizeTo(1200, 500);
    window.moveTo(window.screenX, 0);

    var appWindow = window.open(url + '?start=true', 'selenium_main_app_window');
    if (appWindow == null) {
        var errorMessage = "Couldn't open app window; is the pop-up blocker enabled?"
        LOG.error(errorMessage);
        throw new Error("Couldn't open app window; is the pop-up blocker enabled?");
    }

Where is this log.error message stored? Maybe I can post that too.

此 log.error 消息存储在哪里?也许我也可以发这个。

采纳答案by Jonas S?derstr?m

I had a similar problem on Vista and IE8 I would get the same error message

我在 Vista 和 IE8 上遇到了类似的问题,我会收到相同的错误消息

Couldn't open app window; is the pop-up blocker enabled?"

Running my remote control as Admin wasn't an option for me, and also a poor idea from a security perspective. So in the end I manage to solved this by changeing browser from "*ietha" to "*iexploreproxy" grid_configuration.yml

以管理员身份运行我的遥控器对我来说不是一个选择,从安全角度来看也是一个糟糕的主意。所以最后我设法通过将浏览器从“*ietha”更改为“*iexploreproxy” grid_configuration.yml 来解决这个问题

hub:
  port: 4444
    ...
    - name: "Internet Explorer 8 on Vista"
      browser: "*iexploreproxy"
    ...

Alternatively, you can change browser string from the code:

或者,您可以从代码中更改浏览器字符串:

ISelenium selenium = new DefaultSelenium("localhost", 4444, "*iexploreproxy", "http://www.google.com/");

Works like a charm. The only question remaing is if this somehow affects the outcome of the test cases. So far no, but I'll update this answer in case that would happen.

奇迹般有效。唯一的问题是这是否会以某种方式影响测试用例的结果。到目前为止还没有,但我会更新这个答案,以防万一。

回答by user361500

I ran into this on Windows 7 64bit.

我在 Windows 7 64 位上遇到了这个问题。

My solution was:

我的解决方案是:

  1. Disable popup block. - Select "Tools/Popup Blocker/Turn off pop-up blocker"

  2. Disable IE protected mode. - Untick "Tools/Internet Options/Security/Enable protected mode"

  1. 禁用弹出块。- 选择“工具/弹出窗口拦截器/关闭弹出窗口拦截器”

  2. 禁用 IE 保护模式。- 取消勾选“工具/Internet 选项/安全/启用保护模式”

It'd be better just to disable protected modes for known trusted hosts/addresses. I'll leave that as an exercise for the reader.

最好仅禁用已知受信任主机/地址的保护模式。我将把它留给读者作为练习。

回答by SchwartzE

I was experiencing the same problem. I ran the Selenium RC server as an administrator and everything worked fine.

我遇到了同样的问题。我以管理员身份运行 Selenium RC 服务器,一切正常。

回答by Dennis D

I have had the same problem and have found another solution which works for me. Just use the *iexploreproxy setting in the browserString.

我遇到了同样的问题,并找到了另一种适合我的解决方案。只需在 browserString 中使用 *iexploreproxy 设置。

I used:

我用了:

selenium = new DefaultSelenium("localhost", 4444, "*iexploreproxy C:/Program Files/Internet Explorer/iexplorer.exe", "http://www.bbc.co.uk/");

I hope that works for others too :)

我希望这也适用于其他人:)

回答by Brett Rigby

I, too, am experiencing this very problem on a Windows 7 64bit box, trying to run Selenium on it to test and ASP .Net MVC application, written in C#.

我也在 Windows 7 64 位机器上遇到了这个问题,试图在它上面运行 Selenium 来测试和 ASP .Net MVC 应用程序,用 C# 编写。

I am still trying to work out the answer for myself, but I thought I'd post here to tell you of a little progress I have made in getting somethingto work, albeit in Firefox instead of IE.

我仍在努力为自己找出答案,但我想我会在这里发帖告诉您我在使某些东西工作方面取得的一些进展,尽管是在 Firefox 而不是 IE 中。

Here's the line I changed:

这是我更改的行:

selenium = new DefaultSelenium("localhost", 4444, "*chrome C:/Program Files (x86)/Mozilla Firefox/firefox.exe", "http://www.bbc.co.uk/");

I would ideally like for this to work in Internet Explorer 8, but if for the moment, I can begin getting tests working and later change over to use IE again, then great.

理想情况下,我希望它可以在 Internet Explorer 8 中工作,但如果目前我可以开始进行测试,然后再切换到使用 IE,那就太好了。

Hope this helps for your problem with it all.

希望这有助于解决您的所有问题。

回答by John

I had the same problem on Windows 7 64bit IE8. The first step was to disable the IE popup blocker. Then, I got a message in the status bar saying that "Pop-ups were blocked on this page. Press the 'Ctrl' key to allow the pop-ups".

我在 Windows 7 64 位 IE8 上遇到了同样的问题。第一步是禁用 IE 弹出窗口阻止程序。然后,我在状态栏中收到一条消息,说“此页面上的弹出窗口已被阻止。按 'Ctrl' 键以允许弹出窗口”。

It turns out that the Google Toolbar was providing this feature. Disabling it solved the problem. View > Toolbars > Google to toggle.

事实证明,Google 工具栏提供了此功能。禁用它解决了问题。查看 > 工具栏 > Google 进行切换。

John.

约翰。

回答by Chris

If you happen to be doing this from JavaScriptMVC, there is a reference you need to change in \jmvc\plugins\test\drivers\selenium.js:

如果您碰巧从 JavaScriptMVC 执行此操作,则需要在 \jmvc\plugins\test\drivers\selenium.js 中更改参考:

1) Change iexplore to iexploreproxy and you should get better results:

1) 将 iexplore 更改为 iexploreproxy 应该会得到更好的结果:

    msie : (/iexploreproxy/i).test(browserStartCommand),

2) At this point, you'll find that you still get the popup error, but a separate instance of IE has started. Leave that IE window openand restart the tests, but not Selenium.

2)此时,您会发现仍然出现弹出错误,但是已经启动了单独的 IE 实例。保持那个 IE 窗口打开并重新启动测试,但不是 Selenium。

3) Next, the windows should show up in the right place, but IE gives the annoying block active content warning. Allow the content to run and restart the tests, but not Selenium itself.

3) 接下来,窗口应该显示在正确的位置,但是 IE 给出了恼人的块活动内容警告。允许内容运行并重新启动测试,但不允许 Selenium 本身。

This is super clunky, but it at least gets you past that part. If I find more methodical ways to do these things I'll update as needed.

这非常笨重,但至少可以让您通过那部分。如果我找到更多有条不紊的方法来做这些事情,我会根据需要进行更新。

回答by Koder

You can start the test when you disable the Security mode of Internet. Don′t know the correct name for it, but in dutch it is beveiligde modus. I tried modifiing the security settings to dublicate this security mode, but couldn′t find the correct setting for it. It must therefor block more then you can set manually.

您可以在禁用 Internet 安全模式后开始测试。不知道它的正确名称,但在荷兰语中它是 beveiligde modus。我尝试修改安全设置以复制此安全模式,但找不到正确的设置。因此,它必须阻止更多,然后您可以手动设置。