appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Client asking to many times for session

vrunoa opened this issue · comments

commented

Description

I'm seeing the java client asking for getSession too many times, probably like 5,6 times between commands, making the test to run slower. This make a big difference when running on a testing cloud since this calls are adding ~4 seconds between commands in the test.

Environment

This is a problem with the client itself.

  • java client build version or git revision if you use some shapshot: 5.0.4 (havent tried another version)
  • Appium server version or git revision if you use some shapshot: Any
  • Desktop OS/version used to run Appium if necessary: Any
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: Any
  • Mobile platform/version under test: Any
  • Real device or emulator/simulator: Any

Details

Code To Reproduce Issue [ Good To Have ]

Running a simple test using the java client, during logs we can see all the getSession commands.
For ex.

INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, findElements {using=id, value=com.test.app:id/text1}]
Nov 09, 2017 5:39:45 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:45 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:45 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:46 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:46 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:46 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:46 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:46 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:46 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:46 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:46 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:47 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:47 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:47 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:47 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:47 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:47 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:48 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:48 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:48 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:48 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:48 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:48 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:48 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:48 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:49 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:49 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:49 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:49 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:49 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:49 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getSession [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:50 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getSession {}]
Nov 09, 2017 5:39:50 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executing: getElementText [f8b4312dda7c43bfba2620ef50605eec, getElementText {id=5201}]
Nov 09, 2017 5:39:50 PM org.openqa.selenium.remote.RemoteWebDriver log
INFO: Executed: [f8b4312dda7c43bfba2620ef50605eec, getElementText {id=5201}]

Ecxeption stacktraces

No errors.

Link to Appium logs

I'll check it.

@vrunoa There are some question to make it clear:

  • do you use get session details frequently at the client side?
  • do you use page objects?

@vrunoa
The fix was merged. It is going to be published in the first 6.0.0 BETA

commented

@TikhomirovSergey was this already published ?

Downloading: https://repo.maven.apache.org/maven2/io/appium/java-client/6.0.0-BETA/java-client-6.0.0-BETA.pom
[WARNING] The POM for io.appium:java-client:jar:6.0.0-BETA is missing, no dependency information available

@vrunoa Nope it isn't published yet. Will be published today or tomorrow.