【问题标题】:Unable to verify details inside a modal using nightwatch js无法使用 nightwatch js 验证模式内的详细信息
【发布时间】:2019-09-28 12:09:01
【问题描述】:

应用程序有一个密码链接,它打开一个接受密码的模式。我无法使用 nightwatch js 在模态中输入密码。申请链接:hometown.in

我试过了

.waitForElementVisible('/html/body/div[7]/div/div/div/div/input', 3000) 

但没用。screenshot of page HTML

【问题讨论】:

  • 您能否将您的 HTML 粘贴到问题正文中而不是发布屏幕截图?这个问题将更容易解决。

标签: javascript selenium e2e-testing


【解决方案1】:

您可以尝试使用相对 XPath,因为它们往往更健壮。

.waitForElementVisible('input[placeholder='Enter Pincode / City']') 

看起来这段代码只是在等待元素存在。您还需要向该元素发送一些文本:

 browser.setValue('input[placeholder='Enter Pincode / City']', ['3000', browser.Keys.ENTER]);

【讨论】:

  • Not working.Getting error as NoSuchElementError: An error occurred while running .setValue() command on /input[@placeholder="Enter Pincode / City"]>:截图链接:ibb.co/ynLyMP5
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-11-18
  • 1970-01-01
  • 2011-09-24
  • 2014-02-05
  • 1970-01-01
  • 2018-12-18
  • 2011-05-30
相关资源
最近更新 更多