appium / appium/java-client

is getPerformanceData() working?

Open
#1,450 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Description

Hi, actually i can´t find getPerformanceData method from driver. I'm triying all classes and interfaces to instantiate and get that method, there isn't.

Did you remove that method?

GetPerformanceData

Environment

  • Java client build version or git revision if you use some snapshot: 7.5
  • Appium server version or git revision if you use some snapshot: 1.20.2
  • Desktop OS/version used to run Appium if necessary: Android
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: Appium.exe
  • Mobile platform/version under test: Android 7.0
  • Real device or emulator/simulator: Real Device

Code To Reproduce Issue [ Good To Have ]

My Pom.xml:

`

4.0.0
com.realplazatestandroid
realplazatestandroid
0.0.1-SNAPSHOT


com.github.appium
java-client
f726f3b


junit
junit
4.12

</dependencies>


<!-- Added for AppCenter/Test runs -->
<repositories>
	<repository>
		<id>jcenter</id>
		<url>https://jcenter.bintray.com/</url>
	</repository> 
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository> 
</repositories>
<profiles>
	<profile>
		<id>repl</id>
		<dependencies>
			<dependency>
				<groupId>com.javarepl</groupId>
				<artifactId>javarepl</artifactId>
				<version>428</version>
			</dependency>
		</dependencies>
		<build>
			<plugins>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<configuration>
						<executable>java</executable>
						<classpathScope>test</classpathScope>
						<arguments>
							<argument>-Djansi.passthrough=true</argument>
							<argument>-classpath</argument>
							<classpath />
							<argument>javarepl.Main</argument>
						</arguments>
					</configuration>
					<executions>
						<execution>
							<id>runRepl</id>
							<phase>process-test-classes</phase>
							<goals>
								<goal>exec</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile> 
</profiles>
`

My Java test class:

`
package realplazatestandroid;

import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidTouchAction;
import io.appium.java_client.remote.MobileCapabilityType;

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.junit.rules.TestWatcher;
import org.junit.runners.MethodSorters;
import org.junit.Rule;

@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class androidTest {

private static  AndroidDriver<MobileElement> driver = null;
private static MobileElement CalculatorResult = null;

@BeforeClass
public static void startApp() throws MalformedURLException {
	DesiredCapabilities capabilities = new DesiredCapabilities(); 
	capabilities.setCapability("appPackage", "com.realplazago.app");
	capabilities.setCapability("appActivity", ".MainActivity");
	capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "android");
	capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.0");
	capabilities.setCapability("autoGrantPermissions", true);
	capabilities.setCapability(MobileCapabilityType.UDID, "MWS0216C02001198");
	capabilities.setCapability("browserstack.networkLogs", "true");
	capabilities.setCapability(MobileCapabilityType.APP,
			"D:\\app-release.apk");
	capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 7913);
	capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "Appium");

	URL url = new URL("http://localhost:4723/wd/hub"); 
    driver = new  AndroidDriver<MobileElement>(url, capabilities);   
    driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS); 
}

@Test
public void stage1_canStartAppInTest() throws MalformedURLException, InterruptedException {
	CaptureScreenshot("Launch");
	driver.launchApp(); 
	CaptureScreenshot("Starting");
}

@Test
public void stage2_canGestureAppInTest() throws Exception, InterruptedException { 
	driver.launchApp();
	if (driver != null) {
		AndroidTouchAction action = null;

		CaptureScreenshot("Starting"); 
		WebDriverWait wait = new WebDriverWait(driver, 30);
		wait.until(ExpectedConditions.elementToBeClickable(By.xpath(
				"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]/android.widget.ImageView[1]")));
		MobileElement el1 = (MobileElement) driver.findElementByXPath(
				"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]/android.widget.ImageView[1]");
		el1.click(); 
	} else {
		throw new Exception("App launched dependency");
	}

}

private void CaptureScreenshot(String name) {
	File file = driver.getScreenshotAs(OutputType.FILE);
	try {
		FileUtils.copyFile(file, new File(name + ".png"));
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} 
}

@After
public void after() throws Exception {
	if (driver != null) {
		driver.quit();
	}
}

}
`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting AndroidDriver's public API for getPerformanceData and compare it with the linked Appium command documentation; use the Java test class and Maven dependency shown to reproduce against client 7.5. Done means confirming whether the command is exposed for this driver and version, then recording the supported usage or incompatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.