Пом:
Код: Выделить всё
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
framework
0.0.1-SNAPSHOT
UTF-8
src/TestSuites/
testng.xml
1.8
1.8
http://selenium-hub-1.qa.automation.vpc:4444/wd/hub
org.apache.maven.plugins
maven-compiler-plugin
3.8.1
1.8
1.8
org.apache.maven.plugins
maven-surefire-plugin
3.0.0-M3
${SuiteXmlFile}
org.testng
testng
7.4.0
log4j
log4j
1.2.17
junit
junit
4.12
test
commons-io
commons-io
2.11.0
org.seleniumhq.selenium
selenium-java
4.5.0
org.seleniumhq.selenium
selenium-remote-driver
3.6.0
org.apache.poi
poi-ooxml
5.2.3
org.seleniumhq.selenium
selenium-chrome-driver
4.5.0
io.github.bonigarcia
webdrivermanager
5.3.0
mysql
mysql-connector-java
8.0.31
io.appium
java-client
8.2.0
org.apache.logging.log4j
log4j-to-slf4j
2.19.0
Код: Выделить всё
/**
* Registers a real lock from locations screen
*
* @throws InterruptedException
*/
public void addLock(String serialNumber, String model, String lockName) throws InterruptedException{
logg.info("Adding a device");
withAction.mobileClick(btnAddLock);
logg.info("Add Lock button is clicked");
logg.info("Clicking Scan QR Code button");
withAction.mobileClick(btnScanQRCode);
logg.info("Sending a serial number into the enter serial number manually field");
logg.info("Clicking Enter Serial Number Manually button");
withAction.mobileClick(btnEnterSNManually);
logg.info("Validating Enter serial number is displayed");
withAssert.mobileStringExists(txtEnterSN, "Enter serial number");
withAction.sendText(btnEnterSN, serialNumber);
logg.info("Clicking a model tile");
WebElement element = appiumDriver.findElement(By.xpath("//*[@text='" + model + "']"));
withAction.mobileClick(element);
logg.info("Clicking continue button");
withAction.mobileClick(btnContinue);
logg.info("Validating the next screen that is showing You are almost done! text");
withAssert.mobileStringExists(txtAlmostDone, "You are almost done!");
logg.info("Sending a name to a lock");
withAction.sendText(btnLockName, lockName);
withAction.mobileBack();
logg.info("Validating save button");
withAssert.mobileStringExists(txtSave, "Save");
Thread.sleep(3000);
logg.info("Clicking save lock button");
withAction.mobileClick(btnSaveLock); //this is where it needs to click
logg.info("Validating success message");
withAssert.mobileStringExists(txtSuccess, "Success!");
logg.info("Clicking next button");
withAction.mobileClick(btnNext);
logg.info("Clicking done button");
withAction.mobileClick(btnDone);
logg.info("Validating Lock Setup Not Finished message");
withAssert.mobileStringExists(txtSuccess, "Lock Setup Not Finished");
logg.info("Clicking I'll connect my lock later button");
withAction.mobileClick(btnConnectLater);
}
Код: Выделить всё
/**
* clicks an element
*
* @param element
*/
public void mobileClick(WebElement element) {
logg.info("Clicking an element by xpath");
WebDriverWait wait = new WebDriverWait(appiumDriver, Duration.ofSeconds(30));
wait.until(ExpectedConditions.elementToBeClickable(element)).click();
}

< img alt="Инспектор Appium" src="https://i.sstatic.net/bU09C.png" />
Подробнее здесь: https://stackoverflow.com/questions/743 ... ing-everyw
Мобильная версия