2017-11-09 12 views

답변

0

당신이 장치의 성능 데이터를 얻을 수 있습니다 appium 1.6을 시작으로 : 자세한 내용은

List<String> dataTypes = new ArrayList<String>(); 
dataTypes.add("cpuinfo"); 
dataTypes.add("memoryinfo"); 
dataTypes.add("batteryinfo"); 
dataTypes.add("networkinfo"); 
// check what data type you can get 
List<String> supportedPerformanceDataTypes =driver. 
    getSupportedPerformanceDataTypes(); 
// get data 
List<List<Object>> performanceData =driver. 
    getPerformanceData("your.app.package", "dataType", dataReadTimeout); 

repository 그래서 Appium 당신은 배터리 상태를 확인하고 변경 여부를 확인 할 수 appium로 이동합니다.

+0

"main"스레드에서이 코드를 실행하면 오류가 발생합니다. org.openqa.selenium.UnsupportedCommandException : URL이 유효한 JSONWP 리소스에 매핑되지 않았습니다 .. – chandru

+0

이제 오류를 해결했습니다.하지만 어떤 정보도 얻지 못하고 있습니다. [cpuinfo, memoryinfo, batteryinfo, networkinfo]와 같은 응답을 반환합니다. – chandru

+0

정보를 주셔서 감사합니다 지금 나는 배터리의 정보를 얻을 수 있습니다. driver.getSupportedPerformanceData() 메소드를 사용하고 있습니다. – chandru