import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class E2E {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "D:\\Selenium\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.flygofirst.com/");
driver.findElement(By.xpath("//span[@id='onewaymodal-id']")).click();
Thread.sleep(25000);
driver.findElement(By.xpath("//div[@id = 'oneWaybd']//div[@class ='fromTo']/div[1]")).sendKeys("Ch");
}
}
我试图在“发件人”文本框中发送密钥,我正在获取的元素不是难以处理的。
我提供了等待时间,以便所有的网页元素将加载。之后,我也得到了相同的异常元素不难处理。
有人能帮我一下吗
1条答案
按热度按时间cgfeq70w1#
你必须修改定位器,试试这个,它的工作:
我也回答了你之前的问题,检查一下,如果有效,就把它标记为答案。