angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Logs can not be viewed in selenium standalone server while running the suites in IE 11 browser #3053

Closed vivekbrahmadandi closed 8 years ago

vivekbrahmadandi commented 8 years ago

When I start the server using the command webdriver-manager start .

seleniumProcess.pid: 8092 18:49:04.240 INFO - Launching a standalone Selenium Server Setting system property webdriver.chrome.driver to C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver_2.21.exe 18:49:04.420 INFO - Java: Oracle Corporation 24.71-b01 18:49:04.420 INFO - OS: Windows 7 6.1 amd64 18:49:04.430 INFO - v2.52.0, with Core v2.52.0. Built from revision 4c2593c 18:49:04.500 INFO - Driver class not found: com.opera.core.systems.OperaDriver 18:49:04.500 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered 18:49:04.500 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped: registration capabilities Capabilities [{platform=MAC, browserName=safari, version=}] does not match the current platform VISTA 18:49:04.757 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub 18:49:04.757 INFO - Selenium Server is up and running.

When i add Internet explorer driver property to selenium args property and selenium address seleniumArgs: ['-Dwebdriver.ie.driver=D:\IEDriverServer_Win32_2.52.0.exe'], seleniumAddress: 'http://localhost:4444/wd/hub',

When I run my suites for IE 11 browser , I can not see the logs in server console.

But i can see the protracto console having throwing the exceptions.

A Jasmine spec timed out. Resetting the WebDriver Control Flow.

Failed: Error while running testForAngular: Page reload detected during async script (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 1.60 seconds Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42' System info: host: 'NBLAP99', ip: '192.168.7.18', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_71' Session ID: 870419fd-9618-42aa-8578-42736a091ab3 Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false, enablePersistentHover=true, ie.ensureCleanSession=false, browserNa viour=dismiss, version=11, pageLoadStrategy=normal, ie.usePerProcessProxy=false, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false, initialBr ssApi=false, nativeEvents=true, browserAttachTimeout=0, ie.browserCommandLineSwitches=, takesScreenshot=true}] Stack: Error: Failed: Error while running testForAngular: Page reload detected during async script (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 1.60 seconds Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42' System info: host: 'NBLAP99', ip: '192.168.7.18', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_71' Session ID: 870419fd-9618-42aa-8578-42736a091ab3 Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false, enablePersistentHover=true, ie.ensureCleanSession=false, browserNa viour=dismiss, version=11, pageLoadStrategy=normal, ie.usePerProcessProxy=false, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false, initialBr ssApi=false, nativeEvents=true, browserAttachTimeout=0, ie.browserCommandLineSwitches=, takesScreenshot=true}] at C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\nodemodules\jasminewd2\index.js:101:16 at Promise.invokeCallback (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\promise.js:1329:14) at TaskQueue.execute (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\promise.js:2790:14) at TaskQueue.executeNext (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2773:21)

1 spec, 1 failure Finished in 170.082 seconds Shutting down selenium standalone server.

C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:365 onError(new Error(message)); ^ Error: ECONNREFUSED connect ECONNREFUSED 192.168.7.18:62366 at ClientRequest. (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:365:15) at emitOne (events.js:77:13) at ClientRequest.emit (events.js:169:7) at Socket.socketErrorListener (_http_client.js:259:9) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at emitErrorNT (net.js:1253:8) at doNTCallback2 (node.js:439:9) at process._tickCallback (node.js:353:17) From: Task: WebDriver.quit() at WebDriver.schedule (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:344:17) at WebDriver.quit (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:419:23) at C:\Users\vivekb\AppData\Roaming\npm\nodemodules\protractor\built\driverProviders\driverProvider.js:67:16 at Promise.invokeCallback (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\promise.js:1329:14) at TaskQueue.execute (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\nodemodules\selenium-webdriver\lib\promise.js:2790:14) at TaskQueue.executeNext (C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2773:21) at C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2697:25 at C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:639:7 at process._tickCallback (node.js:366:9) [launcher] Process exited with error code 1

cnishina commented 8 years ago

Please refer to the referenceConf.js on seleniumArgs. When webdriver-manager start runs, it launches a java command with the options set when it launches (including the internet explorer driver). Once the java command starts, protractor does not give it additional options for other drivers.

The binaries will be saved in C:\Users\vivekb\AppData\Roaming\npm\node_modules\protractor\selenium\. If you prefer to use your D:\ drive, use the out_dir command line option for both the update and start commands. See webdriver-manager help.

Please direct general support questions like this one to an appropriate support channel, see https://github.com/angular/protractor/blob/master/CONTRIBUTING.md#questions

vivekbrahmadandi commented 8 years ago

seleniumAddress: null, // The selenium session id allows Protractor to attach to an existing selenium // browser session. The selenium session is maintained after the test has // completed. Ignored if seleniumAddress is null. seleniumSessionId: null,

how to mention selenium session id,

here is my config file

seleniumAddress: 'http://127.0.0.1:4444/wd/hub', localSeleniumStandaloneOpts: { // The port to start the Selenium Server on, or null if the server should // find its own unused port. port: null, // Additional command line options to pass to selenium. For example, // if you need to change the browser timeout, use // seleniumArgs: ['-browserTimeout=60'] args: ['-Dwebdriver.ie.driver=D:\IEDriverServer_Win32_2.52.0.exe'] },

I wanted to run the suites in IE11 browser

vivekbrahmadandi commented 8 years ago

20:08:46.019 INFO - Executing: [new session: Capabilities [{platform=ANY, count=1, browserName=internet explorer, version=11}]]) 20:08:46.029 INFO - Creating a new session for Capabilities [{platform=ANY, count=1, browserName=internet explorer, version=11}] 20:08:46.059 WARN - Exception thrown java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42' System info: host: 'NBLAP99', ip: '192.168.7.18', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_71' Driver info: driver.version: unknown at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:183) at org.openqa.selenium.remote.server.DefaultSession.(DefaultSession.java:119) at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95) at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:124) at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:59) at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1) at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:111) at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:79) at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:202) at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:164) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:130) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680) at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479) at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920) at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820) at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986) at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837) at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243) at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358) at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537) Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42' System info: host: 'NBLAP99', ip: '192.168.7.18', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_71' Driver info: driver.version: unknown at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:113) at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:97) at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60) at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222) 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:176) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.reflect.InvocationTargetException 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.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:103) ... 9 more 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 https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html at com.google.common.base.Preconditions.checkState(Preconditions.java:199) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109) at org.openqa.selenium.ie.InternetExplorerDriverService.access$0(InternetExplorerDriverService.java:1) at org.openqa.selenium.ie.InternetExplorerDriverService$Builder.findDefaultExecutable(InternetExplorerDriverService.java:167) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296) at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:251) at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:172) at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:150) ... 14 more 20:08:46.069 WARN - Exception: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloade d from http://selenium-release.storage.googleapis.com/index.html

vivekbrahmadandi commented 8 years ago

20:12:04.956 WARN - Exception: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html

cnishina commented 8 years ago

So what's going on behind the scenes:

This is really your best bet for launching with iedriver.

vivekbrahmadandi commented 8 years ago

Do I need to set this property -Dwebdriver.ie.driver in conf file or path env variable

cnishina commented 8 years ago

No you do not have to set that in your environment variable. The jar file is fed that information. All you need to do is give it the --ie32 option with webdriver-manager start --ie32