AutoItDriverServer icon indicating copy to clipboard operation
AutoItDriverServer copied to clipboard

Hi, I am trying to use this code but getting error

Open nitikas opened this issue 10 years ago • 8 comments

I am getting error in below line

driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub" ), capabilities);

nitikas avatar Jan 11 '16 12:01 nitikas

What error do you get? You've just pasted a line of code, not the error message. Also what's your environment (OS, Python version, 32 vs 64-bit)

daluu avatar Jan 11 '16 20:01 daluu

I am using Windows 7 64 version.

Error Message. Please help:

org.openqa.selenium.WebDriverException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://code.google.com/p/selenium/downloads/list Command duration or timeout: 8.54 seconds Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:23:22' System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_22' Driver info: org.openqa.selenium.remote.RemoteWebDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:111) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129) at CalculatorTest.setUp(CalculatorTest.java:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107) at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) at org.testng.TestNG.run(TestNG.java:1057) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175) Caused by: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://code.google.com/p/selenium/downloads/list at com.google.common.base.Preconditions.checkState(Preconditions.java:176) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:105) at org.openqa.selenium.ie.InternetExplorerDriverService.access$1(InternetExplorerDriverService.java:1) at org.openqa.selenium.ie.InternetExplorerDriverService$Builder.build(InternetExplorerDriverService.java:177) at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:111) at org.openqa.selenium.ie.InternetExplorerDriver.setup(InternetExplorerDriver.java:104) at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:59) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:57) at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:51) at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:215) at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1) at java.util.concurrent.FutureTask.run(Unknown Source) at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

On Tue, Jan 12, 2016 at 2:10 AM, David Luu [email protected] wrote:

What error do you get? You've just pasted a line of code, not the error message. Also what's your environment (OS, Python version, 32 vs 64-bit)

— Reply to this email directly or view it on GitHub https://github.com/daluu/AutoItDriverServer/issues/8#issuecomment-170683347 .

nitikas avatar Jan 12 '16 01:01 nitikas

ok that's just strange. what is your (desired) capabilities passed to RemoteWebDriver? It seems to me, based on the error, that you are passing the wrong capabilities and so WebDriver thinks you want IEDriver and you haven't defined that properly.

If you really want AutoItDriver, then you want to follow the capabilities defined here: https://github.com/daluu/AutoItDriverServer/blob/master/sample-code/SeleniumIntegrationTest.java#L16 (lines 16-18)

Also make sure you have started AutoItDriverServer (https://github.com/daluu/AutoItDriverServer/blob/master/autoitdriverserver_python/server.py) on the right port. Your line of code shows 4444, the default for AutoItDriverServer is 4723.

daluu avatar Jan 12 '16 04:01 daluu

I am using the same code mentioned in your forum

Do I need to start hub n node? On 12-Jan-2016 10:26 am, "David Luu" [email protected] wrote:

ok that's just strange. what is your (desired) capabilities passed to RemoteWebDriver? It seems to me, based on the error, that you are passing the wrong capabilities and so WebDriver thinks you want IEDriver and you haven't defined that properly.

If you really want AutoItDriver, then you want to follow the capabilities defined here: https://github.com/daluu/AutoItDriverServer/blob/master/sample-code/SeleniumIntegrationTest.java#L16 (lines 16-18)

Also make sure you have started AutoItDriverServer ( https://github.com/daluu/AutoItDriverServer/blob/master/autoitdriverserver_python/server.py) on the right port. Your line of code shows 4444, the default for AutoItDriverServer is 4723.

— Reply to this email directly or view it on GitHub https://github.com/daluu/AutoItDriverServer/issues/8#issuecomment-170791527 .

nitikas avatar Jan 12 '16 05:01 nitikas

You have to run the server to connect to it. There's a way to enable Selenium grid support, but I haven't documented it yet. See issue #7 for some details. So for now, easiest to use it standalone (not with Grid).

If you look at the readme, you start the server via:

python server.py [--help]

passing help option for more details. To set port to 4444 (because 4723 is default) you would do this:

python server.py --port 4444

only after you start the server can you connect to it. If you don't have Python & the dependencies set up, read the readme instructions: https://github.com/daluu/AutoItDriverServer#quick-start--serverimplementation-notes

daluu avatar Jan 12 '16 05:01 daluu

Thanks. I will try and confirm back

On Tue, Jan 12, 2016 at 11:22 AM, David Luu [email protected] wrote:

You have to run the server to connect to it. There's a way to enable Selenium grid support, but I haven't documented it yet. See issue #7 https://github.com/daluu/AutoItDriverServer/issues/7 for some details. So for now, easiest to use it standalone (not with Grid).

If you look at the readme, you start the server via:

python server.py [--help]

passing help option for more details. To set port to 4444 (because 4723 is default) you would do this:

python server.py --port 4444

only after you start the server can you connect to it. If you don't have Python & the dependencies set up, read the readme instructions: https://github.com/daluu/AutoItDriverServer#quick-start--serverimplementation-notes

— Reply to this email directly or view it on GitHub https://github.com/daluu/AutoItDriverServer/issues/8#issuecomment-170805513 .

nitikas avatar Jan 12 '16 05:01 nitikas

Hi Daluu,

I have one scenario wherein we have to automate assessment of our iOS application. -Whenever student appears for any assessment these reports may get affected or changed

  • On the basis of submitted answers for question reports gets generated

Please share your ideas for automating above scenario.

Regards

Nitika

[email protected]

On Tue, Jan 12, 2016 at 2:10 AM, David Luu [email protected] wrote:

What error do you get? You've just pasted a line of code, not the error message. Also what's your environment (OS, Python version, 32 vs 64-bit)

— Reply to this email directly or view it on GitHub https://github.com/daluu/AutoItDriverServer/issues/8#issuecomment-170683347 .

nitikas avatar Jan 26 '16 07:01 nitikas

iOS automation is not supported by AutoItDriverServer which runs on Windows only. I would think you have better luck asking about that scenario at http://discuss.appium.io or https://groups.google.com/forum/#!forum/ios-driver, and as such use tools like Appium or ios-driver.

If you are testing a mobile app scenario that integrates or affects a desktop application, then AutoItDriverServer can be used to handle the desktop side, you would use 2 driver instances then. The mobile driver (Appium/ios-driver) handles the mobile app, and another driver instance for AutoIt. Perform some actions on mobile side then validate changes from AutoIt/desktop side, and vice versa.

I don't have a sample of integration with mobile app, but there is one for web UI with Selenium, the technique should be the same for both.

daluu avatar Jan 26 '16 22:01 daluu