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

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

Closed
Tenit2012 opened this issue Apr 26, 2018 · 12 comments
Assignees
Labels

Comments

@Tenit2012
Copy link

Tenit2012 commented Apr 26, 2018

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!
@Trucnt
Copy link

Trucnt commented Apr 27, 2018

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.

@Trucnt
Copy link

Trucnt commented Apr 27, 2018

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

@TikhomirovSergey
Copy link
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

@TikhomirovSergey
Copy link
Contributor

@Tenit2012 The reply above is for you too.

@Tenit2012
Copy link
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.

@Trucnt
Copy link

Trucnt commented May 3, 2018

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

@TikhomirovSergey
Copy link
Contributor

Guys. I am investigating

@TikhomirovSergey
Copy link
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?

@Trucnt
Copy link

Trucnt commented May 8, 2018

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.

@TikhomirovSergey
Copy link
Contributor

TikhomirovSergey commented May 8, 2018

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

@TikhomirovSergey
Copy link
Contributor

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

TikhomirovSergey added a commit to TikhomirovSergey/java-client that referenced this issue May 11, 2018
@TikhomirovSergey TikhomirovSergey mentioned this issue May 11, 2018
4 tasks
@TikhomirovSergey
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants