0

我寫自動化按鈕使用谷歌模擬器硒的webdriver並在谷歌模擬器

Map<String, String> mobileEmulation = new HashMap<String, String>(); 
    mobileEmulation.put("deviceName", "Google Nexus 5"); 
    Map<String, Object> chromeOptions = new HashMap<String, Object>(); 
    chromeOptions.put("mobileEmulation", mobileEmulation); 
    DesiredCapabilities capabilities = DesiredCapabilities.chrome(); 
    capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions); 
    webDriver = new ChromeDriver(capabilities); 

當我嘗試點擊一個按鈕,手機屏幕上不單擊,,它什麼也不做,沒有錯誤信息此外,測試通過。

WebElement close = webDriver.findElement(By.id("closeIFrame")); 
    close.click(); 

任何想法。謝謝

回答

相關問題