我正试图推出:
java -jar selenium-server-standalone-2.14.0.jar -role hub
Run Code Online (Sandbox Code Playgroud)
从我的命令提示符,但输出如下:
C:\Program Files (x86)>java -jar selenium-server-standalone-2.14.0.jar -role hub
Unable to access jarfile selenium-server-standalone-2.14.0.jar
Run Code Online (Sandbox Code Playgroud)
C:\ Program Files(x86)是jar文件所在的位置.
我把C:\ Program Files(x86)放在我的PATH和CLASSPATH中,它仍然无法正常工作.
我在Visual Studio中的代码使用的是selenium webdriver 2.24.0.我正在使用的测试框架是Nunit.我的代码工作得很好(加载差异浏览器,驱动网站),直到2.24.0版本发布.
我将新的IE独立服务器添加到我的项目中.
现在每当我运行我的代码时,NUnit都会遇到此错误消息.
FirstSeleniumTest.SeleniumTest.TestGoogle:
SetUp : System.InvalidOperationException : Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (NoSuchDriver)
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
Run Code Online (Sandbox Code Playgroud)
然后弹出命令提示符.
Started InternetExplorerDriver server (64-bit)
2.24.0.0
Listening on port 50329
Run Code Online (Sandbox Code Playgroud)
我在IE上禁用了保护模式.仍然没有运气.
如何才能将代码恢复到正确的webdriving状态?
有一个脚本去网站.现在我想登录并进入下一个屏幕.找不到如何转到'用户名:'文本框,然后'密码:'文本框的代码.
我正在使用Visual Studio编写C#来构建Selenium WebDriver代码,然后将其传递给NUnit来运行我的测试.
当我第一次构建和调试我的代码时,它将传递给NUnit,我可以从那里成功运行(加载正确的浏览器加载正确的网页)
直到最近,每当我尝试在NUnit中运行它时,都会发生运行错误:
FirstSeleniumTest.SeleniumTest.TestGoogle:
SetUp : OpenQA.Selenium.WebDriverException : You will need to use add InternetExplorerDriver.UseLegacyInternalServer to the desired capabilities to use the internal native code server library. This functionality will be deprecated in favor of the standalone IEDriverServer.exe server.
----> OpenQA.Selenium.DriverServiceNotFoundException : The file C:\Users\lbrown\Documents\Visual Studio 2010\Projects\ClassLibrary15\ClassLibrary15\bin\Debug\IEDriverServer.exe does not exist. The driver can be downloaded at http://code.google.com/p/selenium/downloads/list
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
Run Code Online (Sandbox Code Playgroud)
我下载了它告诉我的驱动程序,但我不确定接下来要做什么,或者把它放在我的代码中.
我一直在研究如何使用各种不同的方法自动化浏览器测试数周.Seleniums网站非常模糊,这是最好的选择.
我安装了
我终于放弃了自己的尝试,并想知道最好的方法.
我希望能够
我对使用C#进行编程有所了解,并希望通过Nunit运行我的测试.
任何人都可以给我指示或指向我已经拥有它们的网站吗?谢谢.
我在Visual Studio C#语言上使用Selenium Webdriver.Nunit是测试驱动程序.
我正在尝试使用我的用户名和密码登录我的公司网站.
query.SendKeys("myusername");
query.SendKeys(Keys.Tab);
query.SendKeys("mypassword");
Run Code Online (Sandbox Code Playgroud)
我的代码找到用户名文本框,输入"myusername"(示例),正确键入密码框,但是因为它应该在pw文本框中输入"mypassword",它位于用户名文本框并添加(显示" myusernamemypassword")
它不会让我输入密码的原因是什么?