Firefox的驱动程序没有进入的Firstname
字段的值。我想以下几点:
driver.findElement(By.xpath(//*[@id=\JNHGYHG\"]")).sendsKeys("Hello");
有人可以帮我弄这个吗?
试试这个,看看有什么区别。
driver.findElement(By.xpath("//*[@id='JNHGYHG']")).sendKeys("Hello");
正如在你的代码审判提到有你已经使用了Locator Strategy内的错误。
您可以使用以下解决方案:
driver.findElement(By.id("JNHGYHG")).sendKeys("Hello");
driver.findElement(By.cssSelector("#JNHGYHG")).sendKeys("Hello");
driver.findElement(By.xpath("//*[@id='JNHGYHG']")).sendKeys("Hello");
driver.findElement(By.xpath("//*[@id=\"JNHGYHG\"]")).sendKeys("Hello");