Skip to content

java-client's NewSessionPayload.class conflict with selenium's NewSessionPayload.class #875

Closed

Description

@Tenit2012

OS: Windows 10
Selenium Version: 3.9.1
Browser: Firefox
Browser Version: 59.0.2 (64-bit)

Expected Behavior

  • When start Firefox driver will call class NewSessionPageload.java of selenium instead call NewSessionPageload.java of java-client.

Actual Behavior

  • When start Firefox driver called class NewSessionPageload.java of java-client instead call NewSessionPageload.java of selenium.
  • Error message.
    Exception in thread "main" org.openqa.selenium.InvalidArgumentException: firefox_profile is not the name of a known capability or extension capability

Steps to reproduce

  • Please run source code to reproduce :

   public class FirefoxTest {
	public static void main(String[] args) {
         // declaration and instantiation of objects/variables
        System.setProperty("webdriver.gecko.driver", "/path/to/geckodriver_win64.exe");          
        FirefoxProfile ffprofile = new FirefoxProfile();
    	FirefoxOptions firefoxOptions = new FirefoxOptions();
    	firefoxOptions.setProfile(ffprofile);
	WebDriver driver = new FirefoxDriver(firefoxOptions);
        String baseUrl = "http://demo.guru99.com/test/newtours/";
        String expectedTitle = "Welcome: Mercury Tours";
        String actualTitle = "";
        driver.get(baseUrl);
        // get the actual value of the title
        actualTitle = driver.getTitle();
        /*
         * compare the actual title of the page with the expected one and print
         * the result as "Passed" or "Failed"
         */
        if (actualTitle.contentEquals(expectedTitle)){
            System.out.println("Test Passed!");
        } else {
            System.out.println("Test Failed");
        }     
        //close Fire fox
         driver.close();
           }
       }

------------------------------------------pom.xml file------------------------------------------------------

      <?xml version="1.0" encoding="UTF-8"?>
<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>DemoFirefoxDriver</groupId>
<artifactId>DemoFirefoxDriver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
	<selenium.webdriver.version>3.9.1</selenium.webdriver.version>
</properties>
<build>
	<plugins>
		<plugin>
			<!-- Build an executable JAR -->
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-jar-plugin</artifactId>
		</plugin>
	</plugins>
</build>
<dependencies>
	<dependency>
		<groupId>io.appium</groupId>
		<artifactId>java-client</artifactId>
		<version>6.0.0-BETA3</version>
	</dependency>
	<dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-server</artifactId>
		<version>${selenium.webdriver.version}</version>
		<exclusions>
			<exclusion> <!-- declare the exclusion here -->
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>httpclient</artifactId>
			</exclusion>
			<exclusion>
				<groupId>xalan</groupId>
				<artifactId>xalan</artifactId>
			</exclusion>
		</exclusions>
	</dependency>
            <dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-java</artifactId>
		<version>${selenium.webdriver.version}</version>
		<exclusions>
			<exclusion>
				<groupId>org.seleniumhq.selenium</groupId>
				<artifactId>selenium-firefox-driver</artifactId>
			</exclusion>
			<exclusion>
				<groupId>xalan</groupId>
				<artifactId>xalan</artifactId>
			</exclusion>
		</exclusions>
	</dependency>
	<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-firefox-driver -->
	<dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-firefox-driver</artifactId>
		<version>${selenium.webdriver.version}</version>
	</dependency>

	<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-ie-driver -->
	<dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-ie-driver</artifactId>
		<version>${selenium.webdriver.version}</version>
	</dependency>

	<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver -->
	<dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-chrome-driver</artifactId>
		<version>${selenium.webdriver.version}</version>
	</dependency>

	<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-edge-driver -->
	<dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-edge-driver</artifactId>
		<version>${selenium.webdriver.version}</version>
	</dependency>

	<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-safari-driver -->
	<dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-safari-driver</artifactId>
		<version>${selenium.webdriver.version}</version>
	</dependency>
	<dependency>
		<groupId>com.google.guava</groupId>
		<artifactId>guava</artifactId>
		<version>24.0-jre</version>
	</dependency>
</dependencies>

  • This is a bug of java-client?
  • Do Anyone have the workaround for this issue? Please advice me. Thank in advance!

Activity

  1. trucnt commented on Apr 27, 2018

    @trucnt

    Hi @SrinivasanTarget , @TikhomirovSergey ,
    I have same this problem. Can you look into it?
    Please let me know if you've any update/question. Thanks so much.

  2. trucnt commented on Apr 27, 2018

    @trucnt

    Anything works fine until the NewSessionPayload class is created in java-client at version 6.0.0-BETA3.

    Here is a screenshot of java-client's NewSessionPayload class is called:
    newsessionpayload collisions

  3. TikhomirovSergey commented on Apr 27, 2018

    @TikhomirovSergey
    Contributor

    @trucnt
    Hello! Could remove all dependencies on Selenium? I am suspecting the conflict of dependencies on selenium. I am seing that your project is depending on Selenium v3.9.1. Appium java client v6.0.0-BETA3 depends on 3.10. Also you can update your project to v6.0.0-BETA4

  4. TikhomirovSergey commented on Apr 28, 2018

    @TikhomirovSergey
    Contributor

    @Tenit2012 The reply above is for you too.

  5. Tenit2012 commented on May 2, 2018

    @Tenit2012
    Author

    Hi @TikhomirovSergey
    Perhaps you have misunderstood my problem.

    My problem is when I run with Firefox driver, ProtocalHandShake.java class of library selenium called NewsessionPayload.java class of java-client library instead call NewsessionPayload.java class of selenium library.

    I want to run with Firefox driver, ProtocalHandShake.java class will call NewsessionPayload.java of selenium library. Because both selenium and the Appium java-client contains org.openqa.selenium.remote.NewsessionPayload.java.

    Did you reproduce on my issue?
    Please read my issue carefully and let me know if you've any question/concern. Tks.

  6. trucnt commented on May 3, 2018

    @trucnt

    Is it indeed an Appium java client issue, @TikhomirovSergey ?

  7. TikhomirovSergey commented on May 7, 2018

    @TikhomirovSergey
    Contributor

    Guys. I am investigating

  8. TikhomirovSergey commented on May 7, 2018

    @TikhomirovSergey
    Contributor

    Guys @trucnt @Tenit2012
    I can't reproduce the problem.

    The sample

    The console ouput

    image

    It is normal now that NewsessionPayload from appium is used instead of the same class from selenium. It was the necessary step and we hope the situation will be changed. Also the appium lib has all dependencies from selenium.

    Could you remove the dependency on selenium java and add such exclusion to selenium-server dependency? What the result?

  9. trucnt commented on May 8, 2018

    @trucnt

    Hey @TikhomirovSergey ,

    As your suggestion, I have removed both selenium-java and selenium-server but this issue still happens.

    To reproduce this problem, You must create FirefoxDriver with FirefoxOptions and FirefoxProfile is set into FirefoxOptions.

    Further detail, please see screenshot below:

    appium-java-client-issue

    Please let me know if any update. Thanks in advance.

  10. TikhomirovSergey commented on May 8, 2018

    @TikhomirovSergey
    Contributor

    @Tenit2012 Ok. Trying to work it out. Thank you for details

  11. TikhomirovSergey commented on May 8, 2018

    @TikhomirovSergey
    Contributor

    Yes. I could reproduce this error. It seems something was broken because we did not test it on desktop browser.

  12. added a commit that references this issue on May 11, 2018
  13. added a commit that references this issue on May 22, 2018
  14. TikhomirovSergey commented on May 22, 2018

    @TikhomirovSergey
    Contributor

    The fix was merged. It is going to be published soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions