-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于元素判断的回调问题 #26
Labels
Comments
waitForElementByXPath sendKeys 等都是 driver 上的方法,el 上是不存在的 |
非常感谢 @xudafeng @tsj1107 ,promise语法熟悉了一下。 return driver
.elementByName('我 的')
.tap()
.elementByNameOrNull('登录/注册')
.then(function(el){
if(el){
return driver.elementByName('登录/注册')
.click()
.waitForElementByXPath('//UIATextField[1]')
.sendKeys('123456')
.waitForElementByXPath('//UIASecureTextField[1]')
.sendKeys('123')
.sleep(1000)
.sendKeys('\n')
.sleep(5000)
.takeScreenshot();
}else{
return driver
.elementByName('首 页')
.tap();
}
}); |
安卓的各种element方法和hasElement方法 只要找不到元素 直接就抛异常 了 根本没有后面的处理 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
登陆App正常工作的case:
如果需要对是否登陆做判断,根据是否有登陆按钮:
当case运行到el.click后,后面的填写用户名不会再继续执行下去,测试结束。不知道是否是我使用的问题?
The text was updated successfully, but these errors were encountered: