selenium 数据驱动化实例

Posted bzdmz

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了selenium 数据驱动化实例相关的知识,希望对你有一定的参考价值。

 

#encoding=utf-8
class Login():
def __init__(self):
self.driver=driver
def login(self,username,password):
self.driver.find_element_by_id("idInput").clear()
self.driver.find_element_by_id("idInput").send_keys(username)
self.driver.find_element_by_id("pwdInput").clear()
self.driver.find_element_by_id("pwdInput").send_keys(password)
self.driver.find_element_by_id("loginBtn").click()

#退出
def logout(self):
self.driver.find_element_by_link_text("退出").click()
self.driver.quit()













以上是关于selenium 数据驱动化实例的主要内容,如果未能解决你的问题,请参考以下文章

Selenium模块

selenium - 自动化测试模型 - 模块化数据驱动(参数化)

Python+Selenium笔记:数据驱动测试

selenium+python自动化,数据驱动实例

Python Selenium 之数据驱动测试

Python Selenium 之数据驱动测试的实现