Unable to work with Chrome browser using Selenium webdriver in codeception - automation

Starting selenium + chrome driver with this is command
java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium.jar
It start the server
This is my acceptance.suite.yml file
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: ''
browser: chrome
window_size: 1280x768
curl:
CURLOPT_TIMEOUT: 60
This is what i am receiving as error when i try to execute the test case
[Facebook\WebDriver\Exception\UnknownServerException]
unknown error: cannot parse capability: proxy
from unknown error: must be a dictionary
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.2 x86_64) (WARNING: The server d
id not provide any stacktrace information)
Command duration or timeout: 518 milliseconds
Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42'
System info: host: 'FR301-216', ip: '172.16.102.106', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.8.0_65'
Driver info: org.openqa.selenium.chrome.ChromeDriver

This is an existing bug in the new codeception version (2.1.5 and above). The solution is to downgrade your codeception version to 2.1.4.

Related

Selenium ChromeDriver exception

I am getting following error for my ChromeDriver, and I cannot figure out why. Chrome is 68 version and chromedriver is 2.41. This throws following error and does not even open the Chrome browser.
Aug 08, 2018 5:08:23 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
Starting ChromeDriver 2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e) on port 9090
Only local connections are allowed.
geb.driver.DriverCreationException: failed to create driver from callback 'script1533762503012124154837$_run_closure1#2fb69ff6'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:85)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:32)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:84)
at geb.Configuration.createDriver(Configuration.groovy:382)
at geb.Configuration.getDriver(Configuration.groovy:371)
at geb.Browser.getDriver(Browser.groovy:111)
at geb.report.PageSourceReporter.getPageSource(PageSourceReporter.groovy:42)
at geb.report.PageSourceReporter.writePageSource(PageSourceReporter.groovy:38)
at geb.report.PageSourceReporter.writeReport(PageSourceReporter.groovy:29)
at geb.report.CompositeReporter.writeReport(CompositeReporter.groovy:31)
at geb.Browser.report(Browser.groovy:927)
at geb.spock.GebReportingSpec.report(GebReportingSpec.groovy:59)
at geb.spock.GebReportingSpec.cleanup(GebReportingSpec.groovy:46)
> Caused by: org.openqa.selenium.WebDriverException: unknown error:
> cannot parse capability: chromeOptions from unknown error:
> unrecognized chrome option: class (Driver info:
> chromedriver=2.41.578737
> (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT
> 10.0.163 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 12 milliseconds Build info:
> version: '3.13.0', revision: '2f0d292', time:
> '2018-06-25T15:24:21.231Z' System info: host: 'CL-', ip:
> '10', os.name: 'Windows 10', os.arch: 'amd64', os.version:
> '10.0', java.version: '1.8.0_121' Driver info: driver.version:
> ChromeDriver
Here I am not even using any desired Capabilities and I have no idea from where it is getting it.
driver = {
System.setProperty('webdriver.chrome.driver', System.getProperty("user.dir")+'\\src\\test\\resources\\chromedriver.exe')
new ChromeDriver()
}
<seleniumVersion>3.4</seleniumVersion>
What am I doing wrong?
I added Guava jar files and it fixed that issue.
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>22.0</version>
</dependency>

Selenium Grid with Protractor: SessionNotCreatedError at Object.checkLegacyResponse

I'm new to Selenium Grid and I'm trying to execute a protractor test on a remote node.
I'm using a Virtual Machine as Hub, the Node is my local machine which is also the client.
Both hub and node are up and running.
I've set the property seleniumAddress correctly in the conf.js file.
So now when I execute my test by running protractor conf.js, I'm getting this error:
E/launcher - SessionNotCreatedError: Unable to create new service:
ChromeDriverService
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-
08T15:15:08.936Z'
System info: host: 'host-name', ip: 'ip-address', os.name: 'Windows 7',
os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_171'
Driver info: driver.version: unknown
at Object.checkLegacyResponse
I have no idea why I'm getting this error. I tried to fix it by running:
webdriver-manager clean
webdriver-manager update
but it didn't help.
I solved this problem by specifying the location of the chromedriver executable using the argument Dwebdriver.chrome.driver. This argument should be set when starting the node.
chromedriver documentation

Unable to open Chrome browser using selenium 3.10.0

I am using following configuration:
Windows 7
Java: 1.8.0_91
Selenium: 3.10.0
Chrome browser: 62.0
Chrome Driver : 2.34
While running found below error:
org.openqa.selenium.SessionNotCreatedException: session not created exception
from disconnected: unable to connect to renderer
(Session info: chrome=62.0.3202.62)
(Driver info: chromedriver=2.34.522940 (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 938 milliseconds
Build info: version: '3.10.0', revision: '176b4a9', time: '2018-03-02T19:03:16.397Z'
System info: host: 'OFFICE-PC', ip: '192.168.1.230', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_91'
Driver info: driver.version: ChromeDriver
Hmmmmm... Looks familiar.
Have you checked that you are not using a 32bit ChromeDriver for a 64bit Chrome browser?

Protractor tests fail to start on Safari Sierra and throwing driver.version: unknown, SessionNotCreatedError error

Protractor version: 5.1.2
Safari version: 10.1.2
I have enabled 'Allow Remote Automation' from Safari -> Develop and started the safari driver from cmd using the following command:
/usr/bin/safaridriver -p 8844
Now, trying to run the protractor tests using protractor conf.js. The tests fail to start with the following logs:
Build info: version: '3.5.1', revision: '9c21bb67ef', time: '2017-08-16T21:10:06.092Z'
System info: host: 'dyn-49-127-9-116.its.monash.edu.au', ip: 'fe80:0:0:0:479:1a15:751b:51d6%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'
Driver info: driver.version: unknown
[15:28:40] E/launcher - SessionNotCreatedError: Could not create a session: You must enable the 'Allow Remote Automation' option in Safari's Develop menu to control Safari via WebDriver. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 32 milliseconds
Build info: version: '3.5.1', revision: '9c21bb67ef', time: '2017-08-16T21:10:06.092Z'
System info: host: 'dyn-49-127-9-116.its.monash.edu.au', ip: 'fe80:0:0:0:479:1a15:751b:51d6%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'
Driver info: driver.version: unknown
at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
at SessionNotCreatedError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:214:5)
at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:505:15)
at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:440:13)
at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: WebDriver.createSession()
at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
at createDriver (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:167:33)
at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:632:14)
at Hosted.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.ts:60:29)
at Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.ts:225:39)
at q.then.then (/usr/local/lib/node_modules/protractor/lib/runner.ts:391:27)
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:556:49
[15:28:40] E/launcher - Process exited with error code 19
I figured out the issue. Since built in safari driver has a limitation of only one browser window at a time, I quit all the running safari windows and ran the tests again. Worked perfectly fine :)
Reference:
https://webkit.org/blog/6900/webdriver-support-in-safari-10/
Kinda tricky, because currently it's not quite working due webdriver/selenium incompatibilities. We are hoping that, with the new webdriver release, it will work. See here.

Unable to launch Firefox browser in Windows Xp (32 bit) Using Selenium Webdriver

I am unable to launch the firefox browser (49 version) and with Selenium Jar is 2.5.3 .
Getting Below error:-
*2016-11-10 18:45:36 ERROR BrowserConfig:293 - Error in EbselenCore.setBrowser:Specified firefox binary location does not exist or is not a real file: C:\Program Files (x86)\Mozilla Firefox\firefox.exe
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'karthik', ip: '0.0.0.0xx', os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.8.0_111'
Driver info: driver.version: unknown*
Even i tried with the system.setproperty to the
System.setProperty("webdriver.firefox.bin", "xxxxx\\xxx\\firefox.exe");
System.setProperty("webdriver.chrome.driver", "xxxxx\\xxx\\chromedriver.exe");
System.setProperty("webdriver.chrome.bin", "xxxxx\\xxx\\chrome.exe");
Even i tried with the chrome driver :-
Nov 11, 2016 2:29:10 PM org.openqa.selenium.os.UnixProcess checkForErrorSEVERE: org.apache.commons.exec.ExecuteException:Process exited with an error: -1073741511 (Exit value: -1073741511) 2016-11-11 14:29:11 ERROR BrowserConfig:293 - Error in EbselenCore.setBrowser:Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' System info: host: 'karthik', ip: 'x.x.x.x.', os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.8.0_111' Driver info: driver.version: SeleniumChromeDriver
Thanks in advance for your response.
Selenium 2.5.3 only work with firefox 46 and older. You need to use selenium 3 and newer from firefox 47 onwards. You also need to use geckodriver.