Ios Driver - testování
- stáhnout wget - http://rudix.org/packages/wget.html
- stáhnout javu
- stáhnout maven http://maven.apache.org/download.cgi
- Jak aktualizovat na poslední verzi xcode: https://github.com/ios-driver/ios-driver/issues/209
git clone https://github.com/ios-driver/ios-driver.git
cd ios-driver/
git submodule init
git submodule update
mvn package -DskipTests
cp server/target/ios-server-standalone-0.6.6-SNAPSHOT-e1bb7351e221c753ae72895cbd509337ace395a5-jar-with-dependencies.jar ~/Downloads/ios-driver/ios-server-standalone-0.6.6-SNAPSHOT.jar
- nastavení práv na Safari https://github.com/ios-driver/ios-driver/issues/314
HasTouchScreen
- RemoteWebDriver neimplementuje interface HasTouchScreen (na rozdíl od WebDriver v Androidu),
proto si vytvoříme vlastní třídu:
import ...;
public class SwipeableWebDriver extends RemoteWebDriver implements HasTouchScreen {
private RemoteTouchScreen touch;
public SwipeableWebDriver(URL remoteAddress, Capabilities desiredCapabilities) {
super(remoteAddress, desiredCapabilities);
touch = new RemoteTouchScreen(getExecuteMethod());
}
public TouchScreen getTouch() {
return touch;
}
}
a poté inicializujeme jako:
RemoteWebDriver driver = new SwipeableWebDriver(new URL("http://lokalhost:4444/wd/hub"), capabilities);
SendKey
- Při použití metody element.sendKey("string"); vyskočí klávesnice a po zadání textu se může stát, že nepůjde kliknout na jiný tlačítka apod.
- Řešení: Nastavíme capabilities:
cap.setCapability(IOSCapabilities.SHOW_KEYBOARD_AFTER_CLICK_AND_TYPE, true);