元素在定位器中找不到:emailID和locortype:id
baseclassmethod def openqaurl(self): 驱动程序= WebDriver.Chrome(urlpath.pathch) driver.get(url.baseurl) driver.maximize_window() 返回驱动程序
def openSheet(self):
sheetpath = "C:\\Data.xlsx"
sheetname = "credentials"
wb = OS.load_workbook(sheetpath)
ws = wb[sheetname]
email = ws.cell(2, 1).value
pwd = ws.cell(2, 2).value
return email, pwd
类Test_url:
def testURL(self):
baseMethods = BaseClassMethods(self)
driver = baseMethods.openQAUrl()
emailpwd = baseMethods.openSheet()
driver.implicitly_wait(10000)
baseMethods.sendKeys(driver, "EmailId", "id", emailpwd[0])
baseMethods.sendKeys(driver, "//*[@id='Password']", emailpwd[1])
baseMethods.click(driver, "//*[@id='divLoginWrapperLnkBtn']")
Baseclassmethod
def openQAUrl(self):
driver = webdriver.Chrome(URLPath.pathch)
driver.get(Url.baseurl)
driver.maximize_window()
return driver
def openSheet(self):
sheetpath = "C:\\Data.xlsx"
sheetname = "credentials"
wb = OS.load_workbook(sheetpath)
ws = wb[sheetname]
email = ws.cell(2, 1).value
pwd = ws.cell(2, 2).value
return email, pwd
class Test_URL:
def testURL(self):
baseMethods = BaseClassMethods(self)
driver = baseMethods.openQAUrl()
emailpwd = baseMethods.openSheet()
driver.implicitly_wait(10000)
baseMethods.sendKeys(driver, "EmailId", "id", emailpwd[0])
baseMethods.sendKeys(driver, "//*[@id='Password']", emailpwd[1])
baseMethods.click(driver, "//*[@id='divLoginWrapperLnkBtn']")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论