1.cmd + 【 回退之前的跳轉
2.
========
1.id 獲取
2.class 獲取
3.xpath 獲取
4.name 獲取
5.獲取一個,再進行連續的層次深入獲取
6.findElementsByIosNsPredicate 來使用一些表達式來獲取 //此處是返回數組
==========
遇到的奇葩問題
1. XCUIElementTypeTextField 直接sendKeys 會失敗,需要先點擊一下然後再輸入就能正常的輸入進去了
2. 編寫時候能都found 並能進行判斷,但是運行時候不穩定,會出現 no_such_el 問題
==========
一些codefunc
這個是檢測這個控件存在不存在於當前頁面,並且不報錯,然後進行合理的使用
public static boolean isElementExist(IOSDriver driver,String name) {
try {
driver.findElementByName(name);
return true;
}catch (org.openqa.selenium.NoSuchElementException ex){
return false;
}
}