【发布时间】:2018-09-02 18:47:09
【问题描述】:
在 URL "https://cheapticket.in/b2c/flights" 上,单击“注册”按钮后会出现一个弹出框,我想在其中输入电子邮件和所有其他字段,但抛出以下异常:
Exception in thread "main" org.openqa.selenium.ElementNotInteractableException:
Element <input id="" class="fluid" name="login" type="text"> could not be
scrolled into view
package TestPackage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.GeckoDriverService;
public class CheapTickets {
public static void main(String[] args){
System.setProperty("driver.chrome.driver", "D:\\Selenium\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get("https://cheapticket.in/b2c/flights");
System.out.println("Loaded cheaptickets");
//go to sign up
driver.findElement(By.xpath("//a[@id='signup']")).click();
System.out.println("Travelled to signup");
driver.findElement(By.xpath("//input[@class='fluid']")).sendKeys("abc@abc.com");
}
}
我该如何解决这个问题?
【问题讨论】:
-
请发布您目前拥有的代码。
-
@ggorlen 我已经在问题中添加了到目前为止完成的代码。
标签: java selenium selenium-webdriver xpath