【问题标题】:xpath for customer id in hdfc net banking page[Selenium Webdriver] [JAVA]hdfc 网上银行页面中客户 ID 的 xpath [Selenium Webdriver] [JAVA]
【发布时间】:2016-02-13 17:59:53
【问题描述】:

我正在尝试为以下网站查找客户 ID 的 xpath-

https://netbanking.hdfcbank.com/netbanking/?_ga=1.219943581.521154242.1455311784

我尝试过各种 XPath,例如 -

1.//输入[@class='input_password'] 2.html/body/form/table[2]/tbody/tr/td[2]/table/tbody/tr[1]/td[1]/table/tbody/tr[3]/td[2]/表格/tbody/tr[2]/td[2]/span/input

但他们似乎都没有工作。我正在使用 selenium webDriver 发送密钥 例如“123456”到该客户 ID 框,然后点击继续按钮。 但是硒并不是每次都能找到元素。有人可以帮我解决这个问题吗!

【问题讨论】:

  • 各位,我们将不胜感激任何帮助或建议!

标签: java selenium xpath selenium-webdriver


【解决方案1】:

文本框在框架内,你需要先切换到它

// switch to the frame
driver.switchTo().frame("login_page");

// find the text box and write to it 
driver.findElement(By.className("input_password")).sendKeys("123456");

// switch back to main window
driver.switchTo().defaultContent();

【讨论】:

    猜你喜欢
    • 2022-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-21
    • 1970-01-01
    相关资源
    最近更新 更多