1
我正在使用appium selenium进行自动化测试。任何人都可以帮助我找到移动驱动程序的当前网址。试着用driver.getCurrentUrl()。它不起作用如何查找appium中移动测试的当前网址
我正在使用appium selenium进行自动化测试。任何人都可以帮助我找到移动驱动程序的当前网址。试着用driver.getCurrentUrl()。它不起作用如何查找appium中移动测试的当前网址
You need to check the context of the app :
If context is native app , you cant get url of any screen.
If App context is having WEBVIEW you will get URL
How to check context :
Set<String> contextNames = driver.getContextHandles();
for (String contextName : contextNames) {
System.out.println(contextNames);
}
You can switch to WEBVIEW using following code :
if (contextName.contains("WEBVIEW")) {
driver.context("WEBVIEW");
driver.getCurrentUrl()
}
感谢您的回复..我会尝试并让您知道 – Vijay