Appium과 함께 ios 시뮬레이터에서 "홈"화면을 시작하려고하지만이를 수행 할 API를 찾지 못했습니다.Appium에서 "집"버튼을 클릭하거나 ios 시뮬레이터에서 홈 화면을 시작하는 방법은 무엇입니까?
어떤 제안이라도 도움이 될 것입니다.
Appium과 함께 ios 시뮬레이터에서 "홈"화면을 시작하려고하지만이를 수행 할 API를 찾지 못했습니다.Appium에서 "집"버튼을 클릭하거나 ios 시뮬레이터에서 홈 화면을 시작하는 방법은 무엇입니까?
어떤 제안이라도 도움이 될 것입니다.
고마워을 시도 할 수있다 "심지어 자바 로봇 키 보인다 command + shift + home "이 작동하지 않습니다.
그래서 하나의 사과 스크립트를 작성해야했습니다.이 스크립트를 호출하면 시뮬레이터에서 홈 화면이 실행됩니다.
여기가 성공적 메뉴 5 인 ("하드웨어"메뉴에서 "홈"을 선택 후 도크에서 시뮬레이터 아이콘 존재에 마우스 오른쪽 버튼을 클릭하여 포커스에서 시뮬레이터를 가져오고 할 수
try
tell application "System Events"
if exists process "Simulator" then
tell process "Dock"
delay 2
set frontmost to true
activate
tell list 1
try
perform action "AXShowMenu" of UI element "Simulator"
delay 2
#click accssibilitytitle "Open" of menu item of menu1 -- up arrow
key code 126 -- up arrow
key code 126 -- up arrow
key code 126 -- up arrow
key code 126 -- up arrow
key code 126 -- up arrow
-- key code 125 -- down arrow
delay 2
key code 36 -- return key
on error errMsg
if errMsg contains "Simulator" then
log "Simulator is not present in the dock... To run the automation, add Simulator in the dock and try again!!!"
return
else
log errMsg
return
end if
end try
end tell
end tell
end if
end tell
on error errMsg
log errMsg
end try
tell application "System Events" to tell process "Simulator"
tell menu bar item 5 of menu bar 1
delay 3
click
delay 5
click menu item "Home" of menu 1
delay 3
end tell
end tell
입니다).
ios에는 제한 사항이 있습니다 .Ios에서 홈 버튼을 누르는 키 코드를 보낼 수 없으며 홈 버튼을 자동화 할 수 없기 때문에 제한적입니다. 그러나 안드로이드에서는 키 코드를 사용하여이를 수행 할 수 있습니다 .IOS 자동화에서는이를 수행 할 수 없습니다 . 링크 당으로서
: [ENHANCEMENT] 아이폰 OS XCUIT 모드 자동화 : 백그라운드에서 응용 프로그램을 실행하는 API이다 가하고 추가 된 https://github.com/appium/java-client/releases/tag/v5.0.0-BETA6
하나 향상. 홈 화면을 실행시킬 수있는 방법이없는 것처럼
어쩌면 당신은 자바 클라이언트 v5.0.0 - BETA6를 사용하여 시도하고 응답이 API를
테스트 중에 앱을 백그라운드에서 실행할 수 있습니다.
은 5 초iosDriver.runAppInBackground(5);
에 대한 정의 뒤에 배경
@Test
@Description("Some Description")
public void testSearchZeroResultAndHomeBack(){
// run app in background for 5 seconds
iosDriver.runAppInBackground(5);
Assert.assertTrue(isTextDisplayedOnPage("0 ilan"));
}
// 실행 응용 프로그램을
protected IOSDriver iosDriver;
을 추가 당신은이 작업을 수행하는