为了抽象和可重用性,将网页上的元素建模为类的理想方法是什么?element using driver.findElement()
// I am not sure how to use By in here depending uponwhat I pass in the constructor when I create an object of this class.//Other methods which will i
但是,它首先检查元素字段是否存在。这是我的工作职责,但我觉得这太混乱了: if self.driver.find_element_by_xpath("//input[@id/input[@id='address2']"):
self.driver.find_element_by_xpath("//input[@id='add
所以基本上我有一些帮助方法来帮助我调试我的量角器测试用例,我的主要方法之一是等待一个元素被点击,我创建这个循环来给protractor必要的时间来找到并确保元素被启用,但是当一个元素没有找到时,无论是由于找不到元素还是我的脚本上的拼写错误,我希望测试运行停止并将其标记为失败。await console.log(`WAIT TO BE CLICKABLE FAILED:\n${element.parentElementArrayFinder.locator_.value}