I am using chrome browser in selenium project.
Here is the user agent string that I am using:
System.setProperty("webdriver.chrome.driver","C:\\users\\..\\chromedriver.exe");
driver = new ChromeDriver();
What happens IF I run the script:
It open the chrome browser and after some time it close it and giving error:
org.openqa.selenium.WebDriverException: unknown error: unable to
discover open pages (Driver info: chromedriver=2.2,platform=Windows
NT 6.1 x86) (WARNING: The server did not provide any stacktrace
information) Command duration or timeout: 26.83 seconds Build info:
version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:12:12'
System info: host: 'QAVM-9', ip: '27.101.1.26', os.name: 'Windows 7',
os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_45' Driver
info: org.openqa.selenium.chrome.ChromeDriver at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
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.chrome.ChromeDriver.startSession(ChromeDriver.java:182)
at
org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:111)
at
org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:115)
at
org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:161)
at
org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:150)
at
org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:139)
Please help me, It completely stop the execution.
Let me know in case need any other information.
I would suggest you to update your chrome driver since your version is 2.2 and the latest is 2.9. It might be possible that your existing chrome driver might not be supporting your chrome browser if the browser is of latest version.
Chrome driver versions are here
Also check the release notes here. Each chromedriver mentions which chrome browser versions
it supports.
Here's what I did to get rid of that error (
unknown error: unable to discover open pages
)
In your protractor config file, add the following:
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['--no-sandbox']
}
},
The most important line there is the --no-sandbox; adding that line somehow gets rid of that error.
I am not exactly sure why it works but it's a workaround I found while digging around online.
Related
I have set up an ANT project to write my UI automation framework using Selenium 3.4.0. I am using Gecko driver v18.0 for supporting latest FF browser v55.
java version I am using is 1.8. This project initializes the FF browser with "desired capabilities" object and completes the test. IDE used for this project is Eclipse (Enide 2015). The unit testing framework here is TestNG.
I tried to replicate the same in a maven project using 3.4.0 selenium & Gecko driver v18.0. IDE I am using is IntelliJ. But here after the code executes the driver-initialize part, the browser window opens and then the control never comes back to selenium. The browser remains open for 10-15 min & process keeps running in the background. I have to stop the run to come out of it. Unit testing framework for Maven project here JBehave.
So I did few hit and trails to see the compatibility between Selenium and Gecko driver for Firefox:
Selenium 3.4.0 | Firefox v55 | Gecko Driver version - v15 for 32/64 bit |
Result:
After Initializing FF browser, control does not return back to Selenium.
Selenium 3.4.0 | Firefox v55 | Gecko Driver version - v16 for 32/64 bit |
Result:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=false, logLevel=null, prefs={}, profile=null}}], required capabilities = Capabilities [{}]
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'XXXXX', ip: 'xxx.xxx.xx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: FirefoxDriver
Selenium 3.5.1 | Firefox v55 | Gecko Driver version - v15-v19 for 32/64 bit |
Result:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=false, logLevel=null, prefs={}, profile=null}}], required capabilities = Capabilities [{}]
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'XXXXX', ip: 'xxx.xxx.xx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: FirefoxDriver
Selenium 2.53.1 | Firefox v55 | Gecko Driver version - v15 for 32/64 bit |
Result:
WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port 7055
Selenium 2.53.1 | Chrome |
Result:
Test code executed successfully.
Selenium 3.5.1 | Firefox v54 | Gecko Driver version - v16 for 32/64 bit |
Result:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=false, logLevel=null, prefs={}, profile=null}}], required capabilities = Capabilities [{}]
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'XXXXX', ip: 'xxx.xxx.xx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: FirefoxDriver
I have read through most links mentioned below but it did not help-
Selenium 3.4.0 with Firefox 55
https://seleniumhq.wordpress.com/2017/08/09/firefox-55-and-selenium-ide/
Selenium 3.0 Firefx Driver fails with org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session
Unable to create new remote session - Selenium webdriver
https://github.com/mozilla/geckodriver/issues/749
https://github.com/SeleniumHQ/selenium/issues/3630
For the first entry above (...which is Selenium 3.4.0, Firefox v55 and Gecko drover v15 for 32/64 bit windows), when I did Ctrl+Shift+J I got the below log-
1505982873005 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1596" data: no] Stack trace:
loadExtensionState()#resource://gre/modules/addons/XPIProvider.jsm:1596 < getInstallState()#resource://gre/modules/addons/XPIProvider.jsm:1631 < checkForChanges()#resource://gre/modules/addons/XPIProvider.jsm:3152 < startup()#resource://gre/modules/addons/XPIProvider.jsm:2246 < callProvider()#resource://gre/modules/AddonManager.jsm:271 < _startProvider()#resource://gre/modules/AddonManager.jsm:741 < startup()#resource://gre/modules/AddonManager.jsm:908 < startup()#resource://gre/modules/AddonManager.jsm:3122 < observe()#jar:file:///C:/Program%20Files%20(x86)/Mozilla%20Firefox/omni.ja!/components/addonManager.js:65
While creating services from category 'profile-after-change', service for entry 'Notification Telemetry Service', contract ID '#mozilla.org/notificationTelemetryService;1' does not implement nsIObserver.
Warning: unrecognized command line flag --marionette
nsBrowserContentHandler.js:726
PAC file installed from http://autocache.hpecorp.net/
Property contained reference to invalid variable. Error in parsing value for ‘color’. Falling back to ‘inherit’. browser.css:251:7560
DEPRECATION WARNING: Search service falling back to synchronous initialization. This is generally the consequence of an add-on using a deprecated search service API.
My target is to use this framework for UI testing against the latest stable version of IE, Chrome & Firefox browser. Any help in this regard will be helpful.
I am having exactly same issue on MAC osx , I have been looking for solution for a couple of days
508672244107 mozrunner::runner INFO Running command: "/Applications/Firefox.app/Contents/MacOS/firefox-bin" "-marionette" "-profile" "/var/folders/0k/gv7bgjzs157b0mydntwdqj840000gy/T/rust_mozprofile.hixndTibKloe"
1508672244363 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1554" data: no] Stack trace: loadExtensionState()#resource://gre/modules/addons/XPIProvider.jsm:1554 < getInstallState()#resource://gre/modules/addons/XPIProvider.jsm:1589 < checkForChanges()#resource://gre/modules/addons/XPIProvider.jsm:3109 < startup()#resource://gre/modules/addons/XPIProvider.jsm:2188 < callProvider()#resource://gre/modules/AddonManager.jsm:269 < _startProvider()#resource://gre/modules/AddonManager.jsm:739 < startup()#resource://gre/modules/AddonManager.jsm:906 < startup()#resource://gre/modules/AddonManager.jsm:3090 < observe()#jar:file:///Applications/Firefox.app/Contents/Resources/omni.ja!/components/addonManager.js:65
1508672244714 Marionette INFO Enabled via --marionette
2017-10-22 14:37:25.560 plugin-container[2720:62009] * CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xad3f, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2017-10-22 14:37:25.560 plugin-container[2720:62009] * CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x560b, name = 'com.apple.CFPasteboardClient'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2017-10-22 14:37:25.560 plugin-container[2720:62009] void __CFPasteboardSetup() : Failed to allocate communication port for com.apple.CFPasteboardClient; this is likely due to sandbox restrictions
1508672245808 Marionette INFO Listening on port 57372
1508672245923 Marionette DEBUG Register listener.js for window 2147483649
INFO 10/22 11:37:25 o.o.s.r.ProtocolHan~ - Falling back to original OSS JSON Wire Protocol.
INFO 10/22 11:37:25 o.o.s.r.ProtocolHan~ - Falling back to straight W3C remote end connection
22Oct2017 14:37:26,364 [INFO] TestCycle.initializeWebDriver - Error initializining: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions#67c2e933, browserName=firefox, moz:firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions#67c2e933, version=, platform=ANY}], required capabilities = Capabilities [{}]
Build info: version: '3.0.0', revision: '350cf60', time: '2016-10-13 10:48:57 -0700'
System info: host: 'tlv-mpp6a', ip: '172.29.53.33', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_121'
Driver info: driver.version: FirefoxDriver
I'm trying to run some Selenium tests using the ChromeDriver, and I started getting this error:
Starting ChromeDriver 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129) on port 42985
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"7576.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.59)
(Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.48 seconds
Build info: version: 'unknown', revision: '2aa21c1', time: '2016-08-02 14:59:43 -0700'
System info: host: 'SUJITH', ip: '192.168.43.228', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:683)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:143)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
at Selenium.Test2.main(Test2.java:15)
Why is this happening, and how can I fix it?
Update your chromedriver with lastest version. And please clarify your question.
https://chromedriver.storage.googleapis.com/index.html?path=2.24/
If your chrome browser is recently updated to V54.0.x, then you might get this error. The solution for this problem is simply to update your chrome driver.
Choose chrome driver from the below link that will suit your system architecture.
Latest Chromedriver v2.25
This issue started showing up after chrome Version 54.0.x updates.
Remove the older chromedriver from your path and update your chromedriver to 2.24. This should resolve your issue.
I had the same issue . Updating the chrome driver solved my problem.
A few things to bare in mind for these type of cases:
Disable browsers auto update - at least on your slaves to avoid these type of breaking your CI process. Link for how to on Chrome, and be sure to watch these settings on the installation.
Versioning is the first thing to check with Selenium when it breaks all of a sudden. See notes for version compatibility.
I'm using my own Maven plugin to check compatibility between chromedriver and Chrome version
Hope it helps...
You might be using the lower version of the chrome driver.
org.openqa.selenium.SessionNotCreatedException: session not created exception
I had the similar issue and was getting the exception as above. So always check the latest version of driver from here: https://sites.google.com/a/chromium.org/chromedriver/downloads
You might need to set in /etc/hosts
127.0.0.1 localhost
In my case the problem was that I kept a Selenium script running for too much time than I run out of disk free space.
So, I just clean out the Temp folder and created a routine to keep cleaning selenium folders, and problem solved.
You will get this error when your code looks like below:
WebDriver driver = new ChromeDriver();
System.setProperty("webdriver.chrome.driver", "C:\\driver\\chromedriver.exe");
You have to setProperty first and then create driver instance next
System.setProperty("webdriver.chrome.driver", "C:\\driver\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
Does anyone know how to setup the Microsoft Edge browser with Protractor?
I'm using Protractor (Javascript) and Gulp; NOT Java or C#.
Here's my Protractor config file:
exports.config = {
framework: 'cucumber',
seleniumArgs: ['-Dwebdriver.ie.driver=node_modules/protractor/selenium/MicrosoftWebDriver.exe'],
multiCapabilities: {
'browserName': 'MicrosoftEdge',
javascriptEnabled=true,
//'platform': 'windows',
// 'version': '11'
}
,
{
'browserName': 'chrome',
loggingPrefs: {
driver: 'DEBUG',
server: 'INFO',
browser: 'ALL'
}
}],
}
1. I specify the browser name which is 'MicrosoftEdge' then
2. I thought I would point to the EdgeDriver.exe just like I did and it worked for the IE browser.
What else am I missing, this successfully opens up the Edge browser but fails to navigate to a URL with error
var template = new Error(this.message);
^
UnknownError: null (WARNING: The server did not provide any stacktrace information)
Has anyone successfully set up Microsoft Edge with Protractor/CucumberJS?
I just had the same problem as you outlined,I noticed you and I are running the same build of Windows 10,
I have managed to find a solution to my problem if you see the small print around the download link on https://msdn.microsoft.com/en-us//library/mt188085(v=vs.85).aspx
You'll notice there are three driver versions try install the following one:
Windows 10 Fall 2015 Update, install Microsoft WebDriver Fall 2015 Update.
From the install directory take the 'MicrosoftWebDriver.exe' and replace your current one.
I think you are looking for is the Browser Fingerprint.
While not complete (including MS-Edge), it should point you in the correct direction..
https://en.wikipedia.org/wiki/Device_fingerprint#External_links
Especially - http://www.darkwavetech.com/fingerprint/fingerprint_code.html
Hope this helps!
I ended up doing the following to get Mircosoft Edge to launch from Protractor.
Here's where I got the driver for Microsoft Edge (https://www.microsoft.com/en-us/download/details.aspx?id=48212); you can install the .msi file and it'll give you a .exe which you can drop in to a location of your choice:
Here's my config file for Microsoft Edge:
exports.config = {
framework: 'cucumber',
//Microsoft Edge
seleniumArgs: ['-Dwebdriver.edge.driver=node_modules/protractor/selenium/MicrosoftWebDriver.exe'],
capabilities: {
'browserName': 'MicrosoftEdge',
'platform': 'windows',
// 'version': '11'
},
}
Please note if you wanted to just get IE11 then you would use this instead and make sure to point it to wherever you downloaded the ieDriver (http://www.seleniumhq.org/download/) to your local machine:
seleniumArgs: ['webdriver.ie.driver=node_modules/protractor/selenium/IEDriverServer.exe'],
And don't forget to change the browser name to 'browserName': 'internet explorer',
This is just a step closer to getting Protractor(Javascript and Gulp, please NO Java or C#) to work with Microsoft Edge on Windows 10 OS, this launches the Microsoft Edge browser; however I am still running into issues such as:
var template = new Error(this.message);
^
UnknownError: null (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 6.95 seconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'DEV-6', ip: '10.10.50.25', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_65'
Driver info: org.openqa.selenium.edge.EdgeDriver
at new bot.Error
This is a work in progress so I'll update this post as I get more meaningful results; if anyone knows of how to avoid this error to successfully automate Microsoft Edge with Protractor please suggest it here.
And please note I am NOT using the Java or C# bindings which seem to be very popular on Google results; instead I am using Protractor with Javascript and gulp for my e2e tests. Any help much appreciated thanks.
For those who want to start a protractor test with edge, here is the relevant part of my protractor.conf :
seleniumArgs: ['-Dwebdriver.edge.driver=node_modules/protractor/selenium/MicrosoftWebDriver.exe'],
baseUrl: 'http://127.0.0.1:4321/index_protractor.html',
capabilities: {
'browserName': 'MicrosoftEdge'
},
So it's a mix between all you can read on the Internet (note that the case is important with MicrosoftEdge).
On the upside, Edge is started and I see the url changing, etc
On the downside, every test I tried failed with this error :
Message:
Failed: Error while running testForAngular: not implemented (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3 milliseconds
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'PORTABLE-SL3', ip: '192.168.43.171', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_66'
Driver info: org.openqa.selenium.edge.EdgeDriver
Capabilities [{acceptSslCerts=true, browserVersion=20.10240.16384.0, platformVersion=10, browserName=MicrosoftEdge, takesScreenshot=true, pageLoadStrategy=normal, takesElementScreenshot=true, platformName=windows, platform=ANY}]
Session ID: 732EDD82-B245-4020-8B0E-3FBE0428AAB6
So I guess the driver is not ready for Angular
EDIT:
Confirmed, adding this line before my browser.get fixed my error
browser.ignoreSynchronization=true;
I had to handle the wait for Angular manually though. Please note also that by.repeater was not working
I'm trying to setup jenkins to run my protractor tests.
I know that I need to run protractor without a browser. How do I setup it?
Which npm packages do I need to install?
My actual packages are (in package.json):
"devDependencies": {
"karma": "~0.12",
"karma-phantomjs-launcher": "~0.2",
"karma-ng-html2js-preprocessor": "~0.1",
"protractor": "~2.1.0",
"bower": "~1.3.8",
"jasmine": "~2.3.1",
"karma-jasmine": "~0.3.5",
"karma-requirejs": "~0.2.2"
}
In my local machine everything works fine, because I see the chrome windows opening, and I see the tests happening on it.
But when I try to run it on Jenkins, I've got this messages:
Caused by: org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-24-generic', java.version: '1.8.0_25'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:593)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:139)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:171)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:139)
... 14 more
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-24-generic', java.version: '1.8.0_25'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:171)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:62)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)
... 19 more
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:4945/status] to be available after 20001 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:104)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:168)
... 21 more
My protractor.conf.js:
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://localhost:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['incognito', 'disable-extensions', 'start-maximized', 'enable-crash-reporter-for-testing', '--test-type']
},
'loggingPrefs': {
'browser': 'ALL'
}
},
getPageTimeout: 20000,
framework: 'jasmine2',
// Spec patterns are relative to the current working directly when
// protractor is called.
specs: ['global_setup.js', 'scenarios.js', 'campaign-grid-scenarios.js', 'create-campaign-scenarios.js'],
baseUrl: 'http://localhost:18090',
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
What is causing this timeout? Is that because webdriver is chrome but chrome cannot be opened in my jenkins setup?
I've been looking for similar questions but I didn't found anything related.
Thank you.
That's because chrome is not installed in your Jenkins setup. There are a couple of options for you depending on your situation.
If you have a standalone Jenkins instance and you know that you won't have any randomly selected nodes then you could use a headless browser implementation like PhantomJS. All you need to make sure that phantomjs is installed on your Jenkins and tell your test to run on phantomjs instead of chrome like browserName : 'phantomjs'. You don't need to include phantomjs in your package.json. Just make sure that PhantomJS is installed and its executable is placed somewhere in the PATH.
Secondly you could setup a Selenium grid and setup nodes with different browsers you want to test. From Jenkins you run tests on the remote selenium grid on the browser of your choice. There are paid, third part options like sauce labs or browser stack if you wish to go that route.
I created a script in Jmeter that works in the gui and I moved it to an AWS instance.
I'm using:
selenium-server-standalone-2.35.0.jar
ChromeDriver (v2.2)
Chromium 37.0.2062.120 Ubuntu 14.04
and Jmeter 2.11
The script works in the gui (where it reaches my site, logs in etc) but in the non gui mode I get this error in the log file:
2014/10/10 17:54:22 ERROR - jmeter.threads.JMeterThread: Test failed! org.openqa.selenium.WebDriverException: unknown error: unable to discover open pages
(Driver info: chromedriver=2.2,platform=Linux 3.13.0-36-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 21.32 seconds
Build info: version: '2.39.0', revision: '14fa800511cc5d66d426e08b0b2ab926c7ed7398', time: '2013-12-16 13:18:38'
System info: host: 'ip-10-1-1-132', ip: '10.1.1.132', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-36-generic', java.version: '1.7.0_65'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
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.chrome.ChromeDriver.startSession(ChromeDriver.java:182)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:111)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:115)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:161)
at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:44)
at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:16)
at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:212)
at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:597)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:961)
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:946)
at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:566)
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:554)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
at java.lang.Thread.run(Thread.java:745)
Any ideas?
You are using a version of ChromeDriver from 2013, which in no way whatsoever is going to support v37 of Chrome.
http://chromedriver.storage.googleapis.com/2.11/notes.txt
----------ChromeDriver v2.11 (2014-10-07)----------
Supports Chrome v36-40
So I'd suggest upgrading to v2.11 and retrying & upgrade Selenium whilst you are at it, v2.35 of Selenium is also from 2013.