2017-08-08 93 views

回答

0
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() 
      } 
+0

感谢您的回复..我会尝试并让您知道 – Vijay