2015-07-10 159 views
0

我試過以下Firefox和IE瀏覽器代碼。 火狐它工作正常,但在IE瀏覽器不工作。即時通訊使用IEv11,硒v2.45,我也嘗試與v2.46和2.44 .IE驅動程序服務器v2.46。請幫我腳本在調試模式下運行良好,但不能在IE瀏覽器運行模式下運行

public class IEBrowser { 
    WebDriver driver; 
    @Test 
    public void url(){ 
    System.setProperty("webdriver.ie.driver", "E:\\IEDriverServer.exe"); 
     driver = new InternetExplorerDriver();    
    driver.get("http://www.toolsqa.com/automation-practice-form/"); 
    driver.findElement(By.name("firstname")).sendKeys("hi"); 
    } 
} 

回答

0

它的工作在我的系統中運行良好的所有browsers.This可能是由於網絡速度well.Any怎麼加WebDriverWait,看看找到之前

driver.get("http://www.toolsqa.com/automation-practice-form/"); 
    WebDriverWait wait = new WebDriverWait(driver, 40);//Unit in Seconds 
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.name("firstname"))).sendKeys("hi"); 
+0

我試過這段代碼,但同樣的問題來了,我給了額外的時間,但它不工作。我的互聯網速度太好,沒有問題,我的連接。 。 –

1

使用此代碼元素:

try { 
      Thread.sleep(10000); 
     } catch(InterruptedException ex) { 
      Thread.currentThread().interrupt(); 
     } 

這適用於任何appium項目。 *也適用於Android Appium。

相關問題