如何在UiAutomator Android中的事件点击之间提供延迟.
第一个事件是在EditText中输入一个URL:
new UiObject(new UiSelector().text("Search here")).setText("abc.com");
getUiDevice.waitForIdle(15000);
Run Code Online (Sandbox Code Playgroud)
这里我在webview中加载一个网页.所以当url加载完成时,我需要检查第二个事件.
第二个事件是检查对象的内容描述:
UiObject curClass = new UiObject(new UiSelector().className("android.widget.RelativeLayout"));
UiObject yCur = curClass.getChild(new UiSelector().description("ye"));
getCurCol();
public void getCurCol() throws UiObjectNotFoundException {
try {
if (yCur.getContentDescription() != null)
report.append("Success");
} catch (Exception e) {
System.err.println("\nCaught Exception: " + e.getMessage());
}
Run Code Online (Sandbox Code Playgroud)
但这似乎并没有起作用.
我只是希望应用程序在检查第二个事件之前等待一段时间.
我知道这三种方法是为UI Automator的延迟提供的 -
public void waitForIdle(long timeout)
public void waitForIdle()
public boolean waitForWindowUpdate(String packageName, long timeout)
Run Code Online (Sandbox Code Playgroud)
但我不知道如何使用这些方法.
请给我一个如何使用这些的例子.
任何帮助,将不胜感激.
谢谢!
我正在尝试使用Appium iOS中的Java为一个应用程序运行我的自动化脚本.
当我在模拟器上运行时,收到以下错误 -
info: Attempting to retry launching instruments, this is retry #1
info: Attempting to run app on iPhone Retina (4-inch) - Simulator - iOS 7.1
info: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -w iPhone Retina (4-inch) - Simulator - iOS 7.1 /Users/abc/Desktop/smriti/iPhoneSimulator/AppIOS.app -e UIASCRIPT /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/uiauto/bootstrap.js -e UIARESULTSPATH /tmp/appium-instruments
info: And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd"}
info: And launch timeout: 90000ms
info: [INST STDERR] posix spawn failure; aborting launch (binary == /Users/abc/Desktop/smriti/iPhoneSimulator/AppIOS.app/AppIOS).
info: [INST STDERR] Instruments Trace Error …Run Code Online (Sandbox Code Playgroud) 我正在使用NightWatch进行e2e测试,并希望转向ES6编写测试的方式.我能够用Babel做到这一点并且工作正常,但我想使用打字稿.我用TypeScript找不到很多关于NightWatch的文档.找到一些github存储库:
但这些不包含任何有关打字稿的详细文档.
任何帮助,将不胜感激!
在使用Appium的iOS自动化中,有什么方法可以执行以下过程?
我尝试了这些:
RemoteWebDriver wd = null;
wd.close();
Run Code Online (Sandbox Code Playgroud)
但是它只是退出了wd.quit()我正在自动化的应用程序(就像一样),然后当我尝试重新启动时->从头开始。我正在iPhone模拟器上运行它。
我的自动化测试中有一个脚本(使用量角器(5.4.0)构建并使用 Docker 在 Circle CI 中的 Headless Chrome 上运行),它为我安装了当前最新的 Chrome 浏览器:
apt-get update && apt-get -y install libxss1 libappindicator1 libindicator7
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i ./google-chrome*.deb
apt-get install -yf
Run Code Online (Sandbox Code Playgroud)
该脚本会下载最新的 Chrome 浏览器版本。
有什么方法可以获取旧版本的 chrome.deb 并通过curl 安装,因为自从 chrome 更新以来,我怀疑几乎没有什么东西没有运行,我想用旧版本进行一次测试。
我发现很少有旧的浏览器版本可以安装在 slimjet、ubunutu 等网站上,但我想知道我是否可以通过https://dl.google.com获取它,或者是否有更好的方法来做到这一点。
automated-tests google-chrome docker protractor google-chrome-headless
appium ×2
automation ×2
ios ×2
iphone ×2
android ×1
babeljs ×1
docker ×1
e2e-testing ×1
java ×1
javascript ×1
protractor ×1
typescript ×1