Behat + mink + Selenium2 + chromeDriver: Do not launch chrome browser - selenium-webdriver

I am using ubuntu 14.4.
When I run the test its works fine with firefox, where it launches the FF browser.
But when I try the same with Chrome the test runs but it do not launch the browser.
composer.json
{
"require": {
"behat/behat": "2.4.*#stable",
"behat/mink": "1.5.*#stable",
"behat/mink-goutte-driver": "*",
"behat/mink-extension": "*",
"behat/mink-selenium2-driver": "*"
}
}
behat.yml
default:
paths:
features: features
bootstrap: %behat.paths.features%/bootstrap
extensions:
Behat\MinkExtension\Extension:
base_url: 'path-to-my-site'
default_session: selenium2
browser_name: 'chrome'
goutte: ~
selenium2:
wd_host: "http://127.0.0.1:4444/wd/hub"
Command to start Selenium Server
java -jar /path-to/selenium-server-standalone-2.47.1.jar -Dwebdriver.chrome.driver="/usr/local/share/chromedriver"
This is output of my above command:
11:27:46.064 INFO - Launching a standalone Selenium Server
Setting system property webdriver.chrome.driver to /usr/local/share/chromedriver
11:27:46.101 INFO - Java: Oracle Corporation 24.72-b04
11:27:46.101 INFO - OS: Linux 3.13.0-32-generic amd64
11:27:46.113 INFO - v2.47.1, with Core v2.47.1. Built from revision 411b314
11:27:46.181 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match the current platform LINUX
11:27:46.182 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, browserName=MicrosoftEdge, version=}] does not match the current platform LINUX
11:27:46.182 INFO - Driver class not found: com.opera.core.systems.OperaDriver
11:27:46.182 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
11:27:46.249 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
11:27:46.249 INFO - Selenium Server is up and running
Behat test command:
vendor/bin/behat
Output of behat test
Feature: Home page
I am on a home page
Scenario: Visit homepage # features/test.feature:4
Given I go to "home.html" # FeatureContext::visit()
Then I should see "We can change the world!" # FeatureContext::assertPageContainsText()
Then I follow "Register" # FeatureContext::clickLink()
1 scenario (1 passed)
3 steps (3 passed)
Problem is the Test Works but the chrome browser is not launched. What am I doing wrong?

You should add #javascript tag before scenario, because by default behat is using goutte session which is not using selenium webdriver. More about Goutte driver
#javascript
Scenario: Visit homepage
Or in behat.yml set the default session to selenium2
extensions:
Behat\MinkExtension\Extension:
default_session: selenium2
But after that behat will launch firefox browser, for launching especially chrome - you should add browser_name: chrome option
extensions:
Behat\MinkExtension\Extension:
browser_name: chrome
And also you should specify wd_host params for the selenium2 config param
extensions:
Behat\MinkExtension\Extension:
selenium2:
wd_host: "http://127.0.0.1:4444/wd/hub"

Related

Unable to launch IEDriverServer - Failed to start server with: port=xxxxx

We are trying to launch an IE browser using the RemoteWebDriver interface.
On the client side, we run the following command to start the selenium-standalone-server.jar
java -Dwebdriver.ie.driver=IEDriverServer.exe -jar selenium-standalone-server.jar
The selenium server starts fine, but there is an error when I try to create a session.
18:52:58. 128 INFO - Launching a standalone Selenium Server
18:52:58.236 INFO - Java: Oracle Corporation 25.251-608
18:52:58.236 INFO - OS: Windows Server 2016 10.amd64 18:52:58.266 INFO - V2.53.1, with core v2.53.1. Built from revision a36b8b1
18:52:58.391 INFO - Driver class not found: com.opera.core.systems. OperaDriver
18:52:58.391 INFO - Driver provider com.opera.core.systems. OperaDriver is not registered
18:52:58.426 INFO - Driver provider org.openda. selenium.safari.SafariDriver registration is skipped: registration capabilities Capabilities [{browserName=safari, version, platform-MAC}] does not match the current platforn XP
18:52:58.429 INFO - Driver class not found: org.openga.selenium.htmlunit.Htm UnitDriver
18:52:58.429 INFO - Driver provider org.openga.selenium.htmlunit.HtmlUnitDriver is not registered
18:52:58.551 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:5555/wd/hub
18:52:58.552 INFO - Selenium Server is up and running 18:53:03.425
INFO - Executing: [new session: Capabilities [{browserName-internet explorer}]]>
18:53:03.448 INFO . Creating a new session for Capabilities [{browserName-internet explorer}]
Failed to start the server with: port - '32956', host = '', log level = '', log file = '', whitelisted ips = ''.
The point to note here is the last line
Failed to start the server with: port - '32956', host = '', log level = '', log file = '', whitelisted ips = ''.
After this, the browser does not launch and throws a TimeoutException.
I tried to manually launch the IEDriverServer using the following command:
.\IEDriverServer.exe /host=127.0.0.1 /log-level=DEBUG
And I got the below output
2022-10-11 18:52:29:611 server.cC(86) Starting WebDriver server on port: *5555' on host: 127.0.0.1
2022-10-11 18:52:29:611 IEServer.cpp(32) Driver version: 2.53.1.2 (32-bit) D
2022-10-11 18:52:29:612 server.cc(148) Civetweb ACL is -e.e.e.e/e,+127.0.0.1 W
2022-10-11 18:52:29:614 server.cc(158) Failed to start Civetweb
Failed to start the server with: port - '32956', host = '', log level = '', log file = '', whitelisted ips = ''.
Since the error said Failed to start Civetweb, I tried googling what that was, but couldn't find out what the issue was.
Please help us out.
Below is our environment:
OS: Windows Server 2016
Selenium Version: 2.53.1
IEDriverServer Version: 2.53.1
IE Version (installed on the machine): Version 1067 (OS Build: 14393.5356)

Firefox driver not navigating to new tab

I am facing a problem when I run selenium tests on firefox driver. the issue is that the driver is not navigating to new tab. it open the tab, however the flow is not shifting. these are the dependencies I used in the pom :
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>2.2.0</version>
</dependency>
and this is the instance of firefox driver i am creating-
FirefoxDriverManager.getInstance().setup();
driver = new FirefoxDriver();
this is the import-
import io.github.bonigarcia.wdm.FirefoxDriverManager;
this is the piece of code I used to navigate to the new window.
public void switchToNewWindow() {
parentWindow = driver.getWindowHandle();
Set<String> handles = driver.getWindowHandles();
for (String windowHandle : handles) {
if (!windowHandle.equals(parentWindow)) {
driver.switchTo().window(windowHandle);
driver.manage().window().maximize();
}
}
}
the tests runs fine on chrome browser with out any issues.
this is the version of the firefox browser-
Version 61.0.2 (64-bit)
this is the error message. the locator it failed to detect is in the new tab, which the driver failed to switch to-
Testing started at 16:03 ...
"C:\Program Files\Java\jdk1.8.0_161\bin\java" -Dorg.jetbrains.run.directory=C:\Users\rajeshg\IdeaProjects\nxtier\src\test\Resources\com\unionstreet\NxTier\smokePack "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.4\lib\idea_rt.jar=52489:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_161\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\rt.jar;C:\Users\rajeshg\IdeaProjects\nxtier\target\test-classes;C:\Users\rajeshg\IdeaProjects\nxtier\target\classes;C:\Users\rajeshg\.m2\repository\com\google\guava\guava\23.0\guava-23.0.jar;C:\Users\rajeshg\.m2\repository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;C:\Users\rajeshg\.m2\repository\com\google\errorprone\error_prone_annotations\2.0.18\error_prone_annotations-2.0.18.jar;C:\Users\rajeshg\.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;C:\Users\rajeshg\.m2\repository\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar;C:\Users\rajeshg\.m2\repository\com\jayway\restassured\rest-assured\2.9.0\rest-assured-2.9.0.jar;C:\Users\rajeshg\.m2\repository\org\codehaus\groovy\groovy\2.4.4\groovy-2.4.4.jar;C:\Users\rajeshg\.m2\repository\org\codehaus\groovy\groovy-xml\2.4.4\groovy-xml-2.4.4.jar;C:\Users\rajeshg\.m2\repository\org\apache\httpcomponents\httpclient\4.5.1\httpclient-4.5.1.jar;C:\Users\rajeshg\.m2\repository\org\apache\httpcomponents\httpmime\4.5.1\httpmime-4.5.1.jar;C:\Users\rajeshg\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\rajeshg\.m2\repository\org\hamcrest\hamcrest-library\1.3\hamcrest-library-1.3.jar;C:\Users\rajeshg\.m2\repository\org\ccil\cowan\tagsoup\tagsoup\1.2.1\tagsoup-1.2.1.jar;C:\Users\rajeshg\.m2\repository\com\jayway\restassured\json-path\2.9.0\json-path-2.9.0.jar;C:\Users\rajeshg\.m2\repository\org\codehaus\groovy\groovy-json\2.4.4\groovy-json-2.4.4.jar;C:\Users\rajeshg\.m2\repository\com\jayway\restassured\rest-assured-common\2.9.0\rest-assured-common-2.9.0.jar;C:\Users\rajeshg\.m2\repository\com\jayway\restassured\xml-path\2.9.0\xml-path-2.9.0.jar;C:\Users\rajeshg\.m2\repository\com\jayway\jsonpath\json-path\2.4.0\json-path-2.4.0.jar;C:\Users\rajeshg\.m2\repository\net\minidev\json-smart\2.3\json-smart-2.3.jar;C:\Users\rajeshg\.m2\repository\net\minidev\accessors-smart\1.2\accessors-smart-1.2.jar;C:\Users\rajeshg\.m2\repository\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar;C:\Users\rajeshg\.m2\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;C:\Users\rajeshg\.m2\repository\org\hamcrest\hamcrest-all\1.3\hamcrest-all-1.3.jar;C:\Users\rajeshg\.m2\repository\com\googlecode\json-simple\json-simple\1.1.1\json-simple-1.1.1.jar;C:\Users\rajeshg\.m2\repository\junit\junit\4.12\junit-4.12.jar;C:\Users\rajeshg\.m2\repository\io\github\bonigarcia\webdrivermanager\2.2.0\webdrivermanager-2.2.0.jar;C:\Users\rajeshg\.m2\repository\commons-io\commons-io\2.5\commons-io-2.5.jar;C:\Users\rajeshg\.m2\repository\com\google\code\gson\gson\2.8.0\gson-2.8.0.jar;C:\Users\rajeshg\.m2\repository\org\rauschig\jarchivelib\0.7.1\jarchivelib-0.7.1.jar;C:\Users\rajeshg\.m2\repository\org\apache\commons\commons-compress\1.9\commons-compress-1.9.jar;C:\Users\rajeshg\.m2\repository\org\jsoup\jsoup\1.10.2\jsoup-1.10.2.jar;C:\Users\rajeshg\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\rajeshg\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\rajeshg\.m2\repository\com\vimalselvam\cucumber-extentsreport\1.0.0\cucumber-extentsreport-1.0.0.jar;C:\Users\rajeshg\.m2\repository\info\cukes\cucumber-java\1.2.3\cucumber-java-1.2.3.jar;C:\Users\rajeshg\.m2\repository\com\relevantcodes\extentreports\2.40.2\extentreports-2.40.2.jar;C:\Users\rajeshg\.m2\repository\org\xerial\sqlite-jdbc\3.8.11.1\sqlite-jdbc-3.8.11.1.jar;C:\Users\rajeshg\.m2\repository\org\freemarker\freemarker\2.3.23\freemarker-2.3.23.jar;C:\Users\rajeshg\.m2\repository\org\apache\directory\studio\org.apache.commons.codec\1.8\org.apache.commons.codec-1.8.jar;C:\Users\rajeshg\.m2\repository\org\seleniumhq\selenium\selenium-java\3.14.0\selenium-java-3.14.0.jar;C:\Users\rajeshg\.m2\repository\org\seleniumhq\selenium\selenium-chrome-driver\3.14.0\selenium-chrome-driver-3.14.0.jar;C:\Users\rajeshg\.m2\repository\org\seleniumhq\selenium\selenium-edge-driver\3.14.0\selenium-edge-driver-3.14.0.jar;C:\Users\rajeshg\.m2\repository\org\seleniumhq\selenium\selenium-firefox-driver\3.14.0\selenium-firefox-driver-3.14.0.jar;C:\Users\rajeshg\.m2\repository\org\seleniumhq\selenium\selenium-ie-driver\3.14.0\selenium-ie-driver-3.14.0.jar;C:\Users\rajeshg\.m2\repository\org\seleniumhq\selenium\selenium-opera-driver\3.14.0\selenium-opera-driver-3.14.0.jar;C:\Users\rajeshg\.m2\repository\org\seleniumhq\selenium\selenium-remote-driver\3.14.0\selenium-remote-driver-3.14.0.jar;C:\Users\rajeshg\.m2\repository\org\seleniumhq\selenium\selenium-safari-driver\3.14.0\selenium-safari-driver-3.14.0.jar;C:\Users\rajeshg\.m2\repository\org\seleniumhq\selenium\selenium-support\3.14.0\selenium-support-3.14.0.jar;C:\Users\rajeshg\.m2\repository\net\bytebuddy\byte-buddy\1.8.15\byte-buddy-1.8.15.jar;C:\Users\rajeshg\.m2\repository\org\apache\commons\commons-exec\1.3\commons-exec-1.3.jar;C:\Users\rajeshg\.m2\repository\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;C:\Users\rajeshg\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\rajeshg\.m2\repository\org\apache\httpcomponents\httpcore\4.4.9\httpcore-4.4.9.jar;C:\Users\rajeshg\.m2\repository\com\squareup\okhttp3\okhttp\3.10.0\okhttp-3.10.0.jar;C:\Users\rajeshg\.m2\repository\com\squareup\okio\okio\1.14.1\okio-1.14.1.jar;C:\Users\rajeshg\.m2\repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar;C:\Users\rajeshg\.m2\repository\net\sourceforge\htmlunit\htmlunit\2.18\htmlunit-2.18.jar;C:\Users\rajeshg\.m2\repository\xalan\xalan\2.7.2\xalan-2.7.2.jar;C:\Users\rajeshg\.m2\repository\xalan\serializer\2.7.2\serializer-2.7.2.jar;C:\Users\rajeshg\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\Users\rajeshg\.m2\repository\net\sourceforge\htmlunit\htmlunit-core-js\2.17\htmlunit-core-js-2.17.jar;C:\Users\rajeshg\.m2\repository\xerces\xercesImpl\2.11.0\xercesImpl-2.11.0.jar;C:\Users\rajeshg\.m2\repository\xml-apis\xml-apis\1.4.01\xml-apis-1.4.01.jar;C:\Users\rajeshg\.m2\repository\net\sourceforge\nekohtml\nekohtml\1.9.22\nekohtml-1.9.22.jar;C:\Users\rajeshg\.m2\repository\net\sourceforge\cssparser\cssparser\0.9.16\cssparser-0.9.16.jar;C:\Users\rajeshg\.m2\repository\org\w3c\css\sac\1.3\sac-1.3.jar;C:\Users\rajeshg\.m2\repository\org\eclipse\jetty\websocket\websocket-client\9.2.12.v20150709\websocket-client-9.2.12.v20150709.jar;C:\Users\rajeshg\.m2\repository\org\eclipse\jetty\jetty-util\9.2.12.v20150709\jetty-util-9.2.12.v20150709.jar;C:\Users\rajeshg\.m2\repository\org\eclipse\jetty\jetty-io\9.2.12.v20150709\jetty-io-9.2.12.v20150709.jar;C:\Users\rajeshg\.m2\repository\org\eclipse\jetty\websocket\websocket-common\9.2.12.v20150709\websocket-common-9.2.12.v20150709.jar;C:\Users\rajeshg\.m2\repository\org\eclipse\jetty\websocket\websocket-api\9.2.12.v20150709\websocket-api-9.2.12.v20150709.jar;C:\Users\rajeshg\.m2\repository\net\sourceforge\jtds\jtds\1.3.1\jtds-1.3.1.jar;C:\Users\rajeshg\.m2\repository\xmlunit\xmlunit\1.6\xmlunit-1.6.jar;C:\Users\rajeshg\.m2\repository\com\microsoft\sqlserver\mssql-jdbc\6.1.0.jre8\mssql-jdbc-6.1.0.jre8.jar;C:\Users\rajeshg\.m2\repository\com\microsoft\azure\azure-keyvault\0.9.3\azure-keyvault-0.9.3.jar;C:\Users\rajeshg\.m2\repository\com\microsoft\azure\azure-core\0.9.3\azure-core-0.9.3.jar;C:\Users\rajeshg\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;C:\Users\rajeshg\.m2\repository\javax\mail\mail\1.4.5\mail-1.4.5.jar;C:\Users\rajeshg\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\rajeshg\.m2\repository\com\sun\jersey\jersey-client\1.13\jersey-client-1.13.jar;C:\Users\rajeshg\.m2\repository\com\sun\jersey\jersey-core\1.13\jersey-core-1.13.jar;C:\Users\rajeshg\.m2\repository\com\sun\jersey\jersey-json\1.13\jersey-json-1.13.jar;C:\Users\rajeshg\.m2\repository\org\codehaus\jettison\jettison\1.1\jettison-1.1.jar;C:\Users\rajeshg\.m2\repository\com\sun\xml\bind\jaxb-impl\2.2.3-1\jaxb-impl-2.2.3-1.jar;C:\Users\rajeshg\.m2\repository\javax\xml\bind\jaxb-api\2.2.2\jaxb-api-2.2.2.jar;C:\Users\rajeshg\.m2\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar;C:\Users\rajeshg\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.2\jackson-core-asl-1.9.2.jar;C:\Users\rajeshg\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.2\jackson-mapper-asl-1.9.2.jar;C:\Users\rajeshg\.m2\repository\org\codehaus\jackson\jackson-jaxrs\1.9.2\jackson-jaxrs-1.9.2.jar;C:\Users\rajeshg\.m2\repository\org\codehaus\jackson\jackson-xc\1.9.2\jackson-xc-1.9.2.jar;C:\Users\rajeshg\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar;C:\Users\rajeshg\.m2\repository\com\microsoft\azure\adal4j\1.0.0\adal4j-1.0.0.jar;C:\Users\rajeshg\.m2\repository\com\nimbusds\oauth2-oidc-sdk\4.5\oauth2-oidc-sdk-4.5.jar;C:\Users\rajeshg\.m2\repository\net\jcip\jcip-annotations\1.0\jcip-annotations-1.0.jar;C:\Users\rajeshg\.m2\repository\com\nimbusds\lang-tag\1.4\lang-tag-1.4.jar;C:\Users\rajeshg\.m2\repository\com\nimbusds\nimbus-jose-jwt\3.1.2\nimbus-jose-jwt-3.1.2.jar;C:\Users\rajeshg\.m2\repository\org\bouncycastle\bcprov-jdk15on\1.51\bcprov-jdk15on-1.51.jar;C:\Users\rajeshg\.m2\repository\info\cukes\cucumber-junit\1.2.5\cucumber-junit-1.2.5.jar;C:\Users\rajeshg\.m2\repository\info\cukes\cucumber-core\1.2.5\cucumber-core-1.2.5.jar;C:\Users\rajeshg\.m2\repository\info\cukes\cucumber-html\0.2.3\cucumber-html-0.2.3.jar;C:\Users\rajeshg\.m2\repository\info\cukes\cucumber-jvm-deps\1.0.5\cucumber-jvm-deps-1.0.5.jar;C:\Users\rajeshg\.m2\repository\info\cukes\gherkin\2.12.2\gherkin-2.12.2.jar;C:\Users\rajeshg\.m2\repository\org\apache\pdfbox\pdfbox\2.0.0\pdfbox-2.0.0.jar;C:\Users\rajeshg\.m2\repository\org\apache\pdfbox\fontbox\2.0.0\fontbox-2.0.0.jar;C:\Users\rajeshg\.m2\repository\mysql\mysql-connector-java\6.0.4\mysql-connector-java-6.0.4.jar;C:\Users\rajeshg\.m2\repository\de\redsix\pdfcompare\1.1.25\pdfcompare-1.1.25.jar;C:\Users\rajeshg\.m2\repository\com\typesafe\config\1.3.1\config-1.3.1.jar;C:\Users\rajeshg\.m2\repository\org\dbunit\dbunit\2.5.4\dbunit-2.5.4.jar;C:\Users\rajeshg\.m2\repository\org\apache\poi\poi-ooxml\3.14\poi-ooxml-3.14.jar;C:\Users\rajeshg\.m2\repository\org\apache\poi\poi\3.14\poi-3.14.jar;C:\Users\rajeshg\.m2\repository\org\apache\poi\poi-ooxml-schemas\3.14\poi-ooxml-schemas-3.14.jar;C:\Users\rajeshg\.m2\repository\org\apache\xmlbeans\xmlbeans\2.6.0\xmlbeans-2.6.0.jar;C:\Users\rajeshg\.m2\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;C:\Users\rajeshg\.m2\repository\com\github\virtuald\curvesapi\1.03\curvesapi-1.03.jar;C:\Users\rajeshg\.m2\repository\com\opencsv\opencsv\4.0\opencsv-4.0.jar;C:\Users\rajeshg\.m2\repository\org\apache\commons\commons-text\1.1\commons-text-1.1.jar;C:\Users\rajeshg\.m2\repository\commons-beanutils\commons-beanutils\1.9.3\commons-beanutils-1.9.3.jar;C:\Users\rajeshg\.m2\repository\org\seleniumhq\selenium\selenium-api\3.14.0\selenium-api-3.14.0.jar;C:\Users\rajeshg\.m2\repository\io\netty\netty\3.5.7.Final\netty-3.5.7.Final.jar;C:\Users\rajeshg\.IdeaIC2017.3\config\plugins\cucumber-java\lib\cucumber-jvm-formatter.jar" cucumber.api.cli.Main --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvmSMFormatter --monochrome --name "^Adding pricing details to a newly created customer$" --glue com.unionstreet.support --glue com.unionstreet.NxTier.stepDefs.smokePack C:/Users/rajeshg/IdeaProjects/nxtier/src/test/Resources/com/unionstreet/NxTier/smokePack/NxTier_smokePack.feature
16:03:51.767 [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Reading https://api.github.com/repos/mozilla/geckodriver/releases to seek wires, geckodriver
16:03:52.126 [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Latest version of wires, geckodriver is 0.21.0
16:03:52.157 [main] INFO io.github.bonigarcia.wdm.Downloader - Using binary driver previously downloaded C:\Users\rajeshg\.m2\repository\webdriver\geckodriver\win64\0.21.0\geckodriver.exe
16:03:52.157 [main] DEBUG io.github.bonigarcia.wdm.Downloader - Target folder content: geckodriver.exe
16:03:52.157 [main] INFO io.github.bonigarcia.wdm.Downloader - Using binary driver previously downloaded C:\Users\rajeshg\.m2\repository\webdriver\geckodriver\win64\0.21.0\geckodriver.exe
16:03:52.157 [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.gecko.driver as C:\Users\rajeshg\.m2\repository\webdriver\geckodriver\win64\0.21.0\geckodriver.exe
1533827032298 geckodriver INFO geckodriver 0.21.0
1533827032314 geckodriver INFO Listening on 127.0.0.1:27819
1533827032954 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\rajeshg\\AppData\\Local\\Temp\\rust_mozprofile.DpjbO1o8RyAk"
Unable to read VR Path Registry from C:\Users\rajeshg\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\rajeshg\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\rajeshg\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\rajeshg\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\rajeshg\AppData\Local\openvr\openvrpaths.vrpath
1533827034578 Marionette INFO Listening on port 52497
1533827034618 Marionette WARN TLS certificate errors will be ignored for this session
Aug 09, 2018 4:03:54 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
org.openqa.selenium.TimeoutException: Expected condition failed: waiting for element to be clickable: By.id: DCompany_name (tried for 20 second(s) with 500 milliseconds interval)
at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:113)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:283)
at com.unionstreet.support.ElementUtils.sendText(ElementUtils.java:70)
at com.unionstreet.com.unionstreet.NxTier.pages.NewBusinessCustomerPage.addCompanyInfoForNewBusinessCustomerCreatedWithDefaultContactTypes(NewBusinessCustomerPage.java:65)
at com.unionstreet.NxTier.stepDefs.smokePack.NxTier_smokePack_stepDefs.iHaveAddedANewBusinessCustomer(NxTier_smokePack_stepDefs.java:79)
at ✽.And I have added a new business customer(C:/Users/rajeshg/IdeaProjects/nxtier/src/test/Resources/com/unionstreet/NxTier/smokePack/NxTier_smokePack.feature:45)
Caused by: org.openqa.selenium.NoSuchElementException: Cannot locate an element using By.id: DCompany_name
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'TESTING001', ip: '10.1.8.93', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
Driver info: driver.version: unknown
any help would be much appreciated!
thank you!
1) First you need to retrieve opened tabs
List<String> tabs = new ArrayList<>(driver.getWindowHandles());
2) open new tab
((JavascriptExecutor)driver).executeScript("window.open('/')");
3) navigate to the tab
driver.switchTo.window(tabs.get(index))
100% working solution:
// open new tab
WebDriver driver = DriverFactory.getWebDriver();
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("window.open()");
Thread.sleep(100); // wait to winHandles value increases. Without it will result in random nullPointerException at this point.
// go to tab with index i
WebDriver driver = DriverFactory.getWebDriver();
ArrayList<String> tabs = new ArrayList<String>(driver.getWindowHandles());
driver.switchTo().window(tabs.get(i));
Thread.sleep(100);
// close tab
WebDriver driver = DriverFactory.getWebDriver();
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("window.close()");
Thread.sleep(100);

Protractor acting randomly or occasionally not starting

I've been tasked with writing different suites of tests and tasks automation but Protractor has been acting in a very strange way the past couple days and... I just don't recall having changed anything from the last time my suites ran correctly.
Currently using the latest drivers:
% ./node_modules/webdriver-manager/bin/webdriver-manager status
webdriver-manager: using local installed version 12.1.0
[09:14:25] I/status - selenium standalone version available: 3.13.0 [last]
[09:14:25] I/status - chromedriver version available: 2.40 [last]
[09:14:25] I/status - geckodriver version available: v0.21.0 [last]
[09:14:25] I/status - android-sdk is not present
[09:14:25] I/status - appium is not present
And what appears to be the latest Protractor version:
% ./node_modules/protractor/bin/protractor --version
Version 5.3.2
This is what Protractor's output looks like 80% of the time, when it doesn't run:
% ./node_modules/protractor/bin/protractor ./conf.js --suite scenarios --params.login.usr=$USR_E2E --params.login.pwd=$PWD_E2E --params.env=test
(node:1709) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[09:03:07] W/driverProviders - Using driver provider hosted, but also found extra driver provider parameter(s): seleniumServerJar
[09:03:07] I/launcher - Running 1 instances of WebDriver
[09:03:07] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[09:03:08] E/launcher - Error: NoSuchElementError: no such element: Unable to locate element: {"method":"css selector","selector":"[type="email"]"}
(Session info: headless chrome=67.0.3396.99)
(Driver info: chromedriver=2.40.565386 (45a059dc425e08165f9a10324bd1380cc13ca363),platform=Mac OS X 10.14.0 x86_64)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
[09:03:08] E/launcher - Process exited with error code 100
The corresponding webdriver-manager's output:
% ./node_modules/webdriver-manager/bin/webdriver-manager start
webdriver-manager: using local installed version 12.1.0
[09:30:49] I/start - java -Dwebdriver.chrome.driver=/Users/cyril/Projects/parkopoly_e2e/node_modules/webdriver-manager/selenium/chromedriver_2.40 -Dwebdriver.gecko.driver=/Users/cyril/Projects/parkopoly_e2e/node_modules/webdriver-manager/selenium/geckodriver-v0.21.0 -jar /Users/cyril/Projects/parkopoly_e2e/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.13.0.jar -port 4444
[09:30:49] I/start - seleniumProcess.pid: 1791
09:30:49.534 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.13.0', revision: '2f0d292'
09:30:49.535 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
2018-07-16 09:30:49.613:INFO::main: Logging initialized #282ms to org.seleniumhq.jetty9.util.log.StdErrLog
09:30:49.752 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
09:30:55.414 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "chrome",
"chromeOptions": {
"args": [
"--disable-extensions",
"--show-fps-counter=true",
"--disable-infobars",
"--incognito",
"--disable-gpu",
"--headless"
]
},
"count": 1
}
09:30:55.415 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.40.565386 (45a059dc425e08165f9a10324bd1380cc13ca363) on port 24866
Only local connections are allowed.
09:30:55.951 INFO [ProtocolHandshake.createSession] - Detected dialect: OSS
09:30:56.171 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 9ea12201cba04ac9e41639501f0c02e1 (org.openqa.selenium.chrome.ChromeDriverService)
09:30:56.925 INFO [ActiveSessions$1.onStop] - Removing session 9ea12201cba04ac9e41639501f0c02e1 (org.openqa.selenium.chrome.ChromeDriverService)
Here's the conf.js file I'm currently using:
const SpecReporter = require('jasmine-spec-reporter').SpecReporter;
exports.config = {
SELENIUM_PROMISE_MANAGER: false,
rootElement: 'html',
seleniumServerJar: './bin/selenium-server-standalone-3.12.0.jar',
seleniumPort: '4444',
seleniumAddress: 'http://localhost:4444/wd/hub',
framework: 'jasmine2',
directConnect: false,
specs: ['./e2e/**/*.spec.js'],
suites: {
cft: './e2e/cft/**/*.spec.js',
scenarios: './e2e/scenarios/**/*.scenario.js'
},
jasmineNodeOpts: {
isVerbose: true,
defaultTimeoutInterval: 15000,
print: function() {}
},
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['--disable-extensions', '--show-fps-counter=true', '--disable-infobars', '--incognito', '--disable-gpu', '--headless']
}
},
onPrepare: async function() {
browser.params.ts = Date.now();
if (browser.params.env === undefined)
browser.params.env = 'test';
await jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStackTrace: true,
displaySuccessful: true,
displayFailed: true,
displayPending: true,
displaySpecDuration: true,
displaySuiteNumber: true
},
summary: {
displayFailures: true,
displayPending: false
},
colors: {
enabled: true,
successful: 'green',
failed: 'red',
pending: 'yellow'
}
}));
await browser.get('https://dashboard-' + browser.params.env + '.website.com');
await browser.driver.findElement(by.css('[type="email"]')).sendKeys(browser.params.login.usr);
await browser.driver.findElement(by.css('[type="password"]')).sendKeys(browser.params.login.pwd);
await browser.driver.findElement(by.css('[type="submit"]')).click();
return await browser.driver.wait(function() {
return browser.driver.getCurrentUrl().then(function(url) {
return /calendar_bo/.test(url);
});
}, 10000);
}
};
Sometimes, whenever Protractor starts and launch the tests, it just suffers from race conditions.
I couldn't find any thread, post, comment or anyone that ever had such outputs. I'm running out of ideas and I'd appreciate any ideas or potential solutions. Thanks!
Have not enough reputation to comment..
Could it be that you have a seleniumServerJar AND a seleniumAddress configured at the same time? Documentation specifies to use only 1.
Protractor needs to know how to connect to Drivers for the browsers it
is testing on. This is usually done through a Selenium Server.
There are five options - specify one of the following:
seleniumServerJar - to start a standalone Selenium Server locally.
seleniumAddress - to connect to a Selenium Server which is already running.
sauceUser/sauceKey - to use remote Selenium Servers via Sauce Labs.
browserstackUser/browserstackKey - to use remote Selenium Servers via BrowserStack.
directConnect - to connect directly to the browser Drivers. This option is only available for Firefox and Chrome.
can you try this code before email send keys:
var EC = protractor.ExpectedConditions;
var email_element = element(by.css('[type="email"]'));
browser.wait(EC.visibilityOf(email_element), 10000);

Error while deploying Hadoop cluster (tutorial): The resource 'projects/project-id was not found

Good morning, I am new to the Google Cloud Platform.
I am trying to follow the tutorial to deploy an Hadoop Cluster and I am experiencing some problems.
I have installed the Cloud SDK, created a new project from the web interface, created a new bucket, enabled billing, obtained the permission "Can edit" (default), generated the pair of ssh keys and put them in $HOME/.ssh/ and configured the bdutil_env.sh script to use my project and my bucket.
This is what happens when I execute some commands in the shell:
$ gcloud auth login
(I choose Allow in the web page opened ->You are now authenticated with the Google Cloud SDK!)
You are now logged in as myaddress#gmail.com.
Your current project is project-id.
My project-id is wordcountex.
Now every command that uses my project gets an error. For example:
$ gcutil getproject --project=project-id --cache_flag_values --dump_request_response
INFO: --request-start--
INFO: -headers-start-
INFO: accept-encoding: gzip, deflate
INFO: accept: application/json
INFO: user-agent: google-api-python-client/1.0
INFO: -headers-end-
INFO: -path-parameters-start-
INFO: project: wordcountex
INFO: -path-parameters-end-
INFO: body: None
INFO: query: ?alt=json
INFO: --request-end--
INFO: URL being requested: https://www.googleapis.com/compute/v1/projects/wordcountex?alt=json
Error: The resource 'projects/project-id' was not found
What should I do now?
I have tried to follow some other guides (this suggested to remove multiple gmail accounts: I did it; it says to visit the Google Compute Engine page once from the console: what does it mean?).
I am running on Ubuntu 14.04 LTS.
I solved my problem enabling the Compute Engine API: Console -> My Project -> APIs & Auth -> APIs.

Protractor seleniumServerJar sets selenium address to http://192.168.0.20:<random-port>

I'm trying to have Protractor start the standalone Selenium Server by setting the seleniumServerJar path according to this github issue, but it starts the selenium server on a different address and port than if you start it with java -jar or with ./node_modules/protractor/bin/webdrivermanager start.
Starting with java -jar /path/to/jar output:
$ java -jar selenium-server-standalone-2.42.2.jar Jun 23, 2014
10:28:25 PM org.openqa.grid.selenium.GridLauncher main INFO: Launching
a standalone server 22:28:25.082 INFO - Java: Apple Inc. 20.65-b04-462
22:28:25.082 INFO - OS: Mac OS X 10.9.3 x86_64 22:28:25.092 INFO -
v2.42.2, with Core v2.42.2. Built from revision 6a6995d 22:28:25.146
INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver
registration is skipped: registration capabilities Capabilities
[{platform=WINDOWS, ensureCleanSession=true, browserName=internet
explorer, version=}] does not match with current platform: MAC
22:28:25.197 INFO - RemoteWebDriver instances should connect to:
http://127.0.0.1:4444/wd/hub 22:28:25.198 INFO - Version Jetty/5.1.x
22:28:25.199 INFO - Started
HttpContext[/selenium-server/driver,/selenium-server/driver]
22:28:25.199 INFO - Started
HttpContext[/selenium-server,/selenium-server] 22:28:25.199 INFO -
Started HttpContext[/,/] 22:28:25.235 INFO - Started
org.openqa.jetty.jetty.servlet.ServletHandler#7786df0f 22:28:25.235
INFO - Started HttpContext[/wd,/wd] 22:28:25.240 INFO - Started
SocketListener on 0.0.0.0:4444 22:28:25.240 INFO - Started
org.openqa.jetty.jetty.Server#42698403
Starting it with Protractor by specifying seleniumServerJar:
$ ./node_modules/protractor/bin/protractor protractor_conf.js Starting
selenium standalone server... Selenium standalone server started at
http://192.168.0.20:59959/wd/hub
And then it hangs and times out.
How does one properly start the standalone selenium server when specifying seleniumServerJar?
Side note: I have put the selenium-server.jar file in my project to make it easy to use relative paths according to aformentioned github issue.
My protractor_conf.js:
exports.config = {
// Do not start a Selenium Standalone sever - only run this using chrome.
//chromeOnly: true,
//chromeDriver: '../node_modules/protractor/selenium/chromedriver',
//we are using a standalone selenium server so give it the local address
//seleniumAddress: 'http://0.0.0.0:4444/wd/hub',
seleniumServerJar: './selenium-server-standalone-2.42.2.jar',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'phantomjs'
},
baseUrl: 'http://localhost:8000',
onPrepare: function () {
require('jasmine-reporters');
var capsPromise = browser.getCapabilities();
capsPromise.then(function (caps) {
var browserName = caps.caps_.browserName.toUpperCase();
var browserVersion = caps.caps_.version;
var prePendStr = browserName + '-' + browserVersion + '-';
jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter('test-results/protractor/', true, true, prePendStr));
});
},
// Spec patterns are relative to the current working directly when
// protractor is called.
specs: ['test/protractor/**/*_spec.js'],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
isVerbose: true,
defaultTimeoutInterval: 30000
},
params: {
env: 'test'
}
};
192.168.0.20 is your local ip address and the port should be 4444 by default, you can change the port with
seleniumPort: 1234
inside your protractor_conf.js (btw: protractor.conf.js is the default config file name for protractor)

Resources