Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error-org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 74. However m/c has chrome version 76 and same supported version chromedriver.exe file has been downloaded to support it. #371

Closed
panimbalkar opened this issue Aug 8, 2019 · 1 comment
Labels

Comments

@panimbalkar
Copy link

panimbalkar commented Aug 8, 2019

Note: Google chrome browser and chrome driver in sync that is for version 76 downloaded required driver jar and used in system property but still shows below error however if I use same code in other non-maven project it works( with 76 chrome and driver used). So it appears there that there is something wrong with dependencies used.
would like to know your solution on this instead of creating new project . Thanks in advance.

Description of the problem:
Expected: Chromebrowser should get launched and execute script.
Actual: Chromebrowser get terminated and logs error: Caused by: org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 74
Browser and version: Google Chrome Version 76.0.3809.100 (Official Build) (64-bit)

Operating system: Windows 7 ,64 bit

WebDriverManager version: 3.6.2

WebDriverManager use:

import org.testng.annotations.Test;

import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import io.github.bonigarcia.*;
import io.github.bonigarcia.wdm.WebDriverManager;

@Test
public class TestLoginSteps {

	WebDriver driver = new ChromeDriver();

	@Given("^open the GoogleChrome and launch the applicaion url$")
	public void open_the_GoogleChrome_and_launch_the_applicaion_url() throws Throwable {
		System.out.println("Maven test");
	//	System.setProperty("webdriver.chrome.driver", "D:/SeleniumJars/chromedriver_win32/chromedriver.exe");
  
		WebDriverManager.chromedriver().version("76.0.38").setup();

		driver.manage().window().maximize();
		driver.get("<applicationURL>"); 

WebDriverManager traces:

Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 47576
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
org.testng.TestNGException: 
Cannot instantiate class stepDefinations.TestLoginSteps
	at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:40)
	at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:377)
	at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:290)
	at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:125)
	at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:190)
	at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:130)
	at org.testng.TestRunner.initMethods(TestRunner.java:424)
	at org.testng.TestRunner.init(TestRunner.java:247)
	at org.testng.TestRunner.init(TestRunner.java:217)
	at org.testng.TestRunner.<init>(TestRunner.java:169)
	at org.testng.remote.RemoteTestNG$1.newTestRunner(RemoteTestNG.java:144)
	at org.testng.remote.RemoteTestNG$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG.java:273)
	at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:594)
	at org.testng.SuiteRunner.init(SuiteRunner.java:168)
	at org.testng.SuiteRunner.<init>(SuiteRunner.java:117)
	at org.testng.TestNG.createSuiteRunner(TestNG.java:1319)
	at org.testng.TestNG.createSuiteRunners(TestNG.java:1306)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1160)
	at org.testng.TestNG.run(TestNG.java:1064)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:113)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:206)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:177)
Caused by: java.lang.reflect.InvocationTargetException
	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.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
	... 21 more
Caused by: org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 74
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.59 seconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'P1LPPQM8372H7R', ip: '10.130.99.204', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_112'
Driver info: driver.version: 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:214)
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
	at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$errorHandler$0(JsonWireProtocolResponse.java:54)
	at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
	at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
	at stepDefinations.TestLoginSteps.<init>(TestLoginSteps.java:20)
	... 26 more


**Error trace**: <!-- Copy the Java error trace (if any) here. -->
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 47576
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
org.testng.TestNGException: 
Cannot instantiate class stepDefinations.TestLoginSteps
	at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:40)
	at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:377)
	at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:290)
	at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:125)
	at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:190)
	at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:130)
	at org.testng.TestRunner.initMethods(TestRunner.java:424)
	at org.testng.TestRunner.init(TestRunner.java:247)
	at org.testng.TestRunner.init(TestRunner.java:217)
	at org.testng.TestRunner.<init>(TestRunner.java:169)
	at org.testng.remote.RemoteTestNG$1.newTestRunner(RemoteTestNG.java:144)
	at org.testng.remote.RemoteTestNG$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG.java:273)
	at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:594)
	at org.testng.SuiteRunner.init(SuiteRunner.java:168)
	at org.testng.SuiteRunner.<init>(SuiteRunner.java:117)
	at org.testng.TestNG.createSuiteRunner(TestNG.java:1319)
	at org.testng.TestNG.createSuiteRunners(TestNG.java:1306)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1160)
	at org.testng.TestNG.run(TestNG.java:1064)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:113)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:206)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:177)
Caused by: java.lang.reflect.InvocationTargetException
	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.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
	... 21 more
Caused by: org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 74
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.59 seconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'P1LPPQM8372H7R', ip: '10.130.99.204', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_112'
Driver info: driver.version: 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:214)
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
	at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$errorHandler$0(JsonWireProtocolResponse.java:54)
	at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
	at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
	at stepDefinations.TestLoginSteps.<init>(TestLoginSteps.java:20)
	... 26 more

POM.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>fiserv</groupId>
  <artifactId>ZelleMasking</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>ZelleMasking</name>
  <description> Zelle masking testing using Selenium -TestNG-BDD and Maven</description>
   <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <!-- <maven.test.skip>true</maven.test.skip> -->  
  </properties>


  <build>
    <pluginManagement>
      <plugins>
       
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
          <configuration>
          <source>1.8</source>
          <target>1.8</target>
            <!-- put your configurations here -->
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M3</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

<dependencies>

			<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
</dependency>
			
    	

		<dependency>
        		<groupId>org.seleniumhq.selenium</groupId>
        		<artifactId>selenium-java</artifactId>
        		<version>3.141.59</version>
    	</dependency> 

    	
    	<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>cucumber-java</artifactId>
			<version>1.2.5</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>cucumber-junit</artifactId>
			<version>1.2.5</version>
			<scope>test</scope>
		</dependency>
		
		
 		
		
		<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>gherkin</artifactId>
			<version>2.12.2</version>
		</dependency>		
		
		
		
		<dependency>
			<groupId>net.masterthought</groupId>
			<artifactId>cucumber-reporting</artifactId>
			<version>1.0.0</version>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>2.0.2-beta</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager -->
<dependency>
    <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>3.6.2</version>
</dependency>
		
  </dependencies>
  
  
</project>
@bonigarcia
Copy link
Owner

You need to call WebDriverManager before instantiating the ChromeDriver object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants