2017-08-08 73 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