java 如何在 Internet Explorer 中运行 selenium rc 测试用例

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4791504/
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-10-30 08:02:32  来源:igfitidea点击:

how to run selenium rc test case in Internet Explorer

javainternet-explorerselenium-rc

提问by Srishti

My selenium RC java code is running successfully on firefox. Can anyone tell me how to run the same test case on internet explorer?

我的 selenium RC java 代码在 Firefox 上成功运行。谁能告诉我如何在 Internet Explorer 上运行相同的测试用例?

回答by Sai Venkat

Change the browser start command string you pass to DefaultSelenium factory. It will be *iehta or *iexplore depending on your selenium version.

更改您传递给 DefaultSelenium 工厂的浏览器启动命令字符串。它将是 *iehta 或 *iexplore,具体取决于您的 selenium 版本。

new DefaultSelenium("localhost", 4444, "*iexplore", "http://www.google.com/");

Check out the docs for more info.

查看文档以获取更多信息。

--Sai

--赛

回答by nss

Just replace *firefoxwith *iexplore. The exact code will vary depending on what language you're writing your test in or how you're actually launching the browser.

只需替换*firefox*iexplore. 确切的代码将根据您编写测试的语言或实际启动浏览器的方式而有所不同。

see: http://seleniumhq.org/docs/05_selenium_rc.html#from-selenese-to-a-programand click the button for your particular language.

请参阅:http: //seleniumhq.org/docs/05_selenium_rc.html#from-selenese-to-a-program并单击您的特定语言的按钮。

回答by user2841770

If you hit the Script error while running tests on IE with selenium RC, it might be because of not running the selenium server with Administrator privileges. I had the similar issue and could get it running with by running the selenium server as an Administrator

如果在使用 selenium RC 在 IE 上运行测试时遇到脚本错误,可能是因为没有以管理员权限运行 selenium 服务器。我遇到了类似的问题,可以通过以管理员身份运行 selenium 服务器来运行它

回答by Ripon Al Wasim

Very simple: Use "*iexplore" instead of "*firefox"

很简单:使用“*iexplore”而不是“*firefox”

回答by user2319033

In order to work the scripts on IE do the following steps

为了在 IE 上运行脚本,请执行以下步骤

1.Navigate to Tools?Internet Options?Security?Trusted Sites

1.导航到工具?Internet选项?安全?可信站点

2.Click on “Sites” button and add the Urls of the application you are testing in “Add this website to the zone:” and clicking on “Add” button.

2.单击“站点”按钮,在“将此网站添加到区域:”中添加您正在测试的应用程序的网址,然后单击“添加”按钮。

3.Navigate to Tools?Internet Options?Security? and disable the checkbox “Enable Protected Mode (requires restarting Internet Explorer)” and click on “Apply” and click “Ok”.

3.导航到工具?Internet选项?安全?并禁用复选框“启用保护模式(需要重新启动 Internet Explorer)”,然后单击“应用”并单击“确定”。

  1. a. Navigate to Tools?Internet Options?Security b. Add all the URL's of your application in the “Address of websites to allow” and click on “Add” button.

  2. Navigate to Tools?Internet Options?Advanced options. Scroll down to the Security section, and select Allow active content to run in files on my computer. This will get rid of the pesky toolbar alert, and allow JavaScript to run automatically.

  1. 一个。导航到工具?Internet 选项?安全 b.在“允许的网站地址”中添加应用程序的所有 URL,然后单击“添加”按钮。

  2. 导航到工具?Internet 选项?高级选项。向下滚动到“安全”部分,然后选择“允许活动内容在我的计算机上的文件中运行”。这将摆脱讨厌的工具栏警报,并允许 JavaScript 自动运行。