【问题标题】:Selenium Location field Auto dropdown is not selectingSelenium 位置字段自动下拉菜单未选择
【发布时间】:2017-03-21 12:04:43
【问题描述】:

driver.findElement(By.id("ProjectAddress")).clear(); driver.findElement(By.id("ProjectAddress")).sendKeys("Chennai"); driver.findElement(By.xpath("//[@id='ProjectAddForm']/fieldset[4]/div/div1")).click(); 线程.sleep(5000);`

【问题讨论】:

  • 你的代码在哪里?的HTML?你想做什么?当你尝试这样做时发生了什么?
  • driver.findElement(By.id("ProjectAddress")).clear(); driver.findElement(By.id("ProjectAddress")).sendKeys("Chennai"); driver.findElement(By.xpath("//*[@id='ProjectAddForm']/fieldset[4]/div/div[1]")).click();线程.sleep(5000);
  • 检查一次代码?我尝试使用 x 路径和 css 选择器
  • @sai 请告诉我解决方案
  • 花一分钟时间将所有问题的详细信息放入问题中,这样人们就不必翻遍所有的 cmets 来查找所有内容。再花一分钟正确格式化问题中的代码和 HTML,以便更容易阅读。

标签: selenium selenium-webdriver selenium-chromedriver selenium-ide selenium-rc


【解决方案1】:
driver.findElement(By.linkText("Chennai, Tamilnadu")).click();

【讨论】:

    猜你喜欢
    • 2023-03-25
    • 1970-01-01
    • 2022-11-11
    • 2018-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-11
    相关资源
    最近更新 更多