Why my test is throwing Exception-Unable to locate element in webdriver?

前端 未结 5 1001
鱼传尺愫
鱼传尺愫 2021-01-24 06:41
package testproject;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.*;
          


        
5条回答
  •  不思量自难忘°
    2021-01-24 07:45

    Are you certain your page is completely loaded after you sign in?

    Did you set a timeout for your webdriver? (how long it has to wait for elements). Probably it reads your html before it's completey loaded.

    Webdriver driver = new FirefoxDriver();
    driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
    

    To find out quickly if this is the problem do Thread.sleep(8000) after you do wb2.click();

提交回复
热议问题