#LEN

python3 win 建立虚拟环境(virtualenv)

1.安装virtualenv  pip3installvirtualenv2.进入即将创建虚拟环境的目录   cdxxxx3.创建虚拟环境  py-3-mvenvtestxunihua4.激活环境  cd ./Scripts  然后执行:activate.bat5.退出  执行 deact...

python爬虫之selenium+打码平台识别验证码

1、常用的打码平台:超级鹰、打码兔等2、打码平台在识别图形验证码和点触验证码上比较好用  (1)12306点触验证码1fromseleniumimportwebdriver2fromselenium.webdriver.supportimportexpected_conditionsasEC3fromselenium....

selenium-登录C语言中文网

fromseleniumimportwebdriverfromselenium.webdriver.support.waitimportWebDriverWaitfromselenium.webdriver.supportimportexpected_conditionsasECfromselenium.webdriv...

selenium之批量执行测试用例生成HTML结果文件

使用HTMLTestRunner运行测试套件,自动生成html测试报告:1importunittest,HTMLTestRunner,sendmail_html2importtime,os34case_dir='D:\pywork\pyworkspace\yzwx_selenium\batch_case\test_ca...

selenium之批量执行测试用例

把写好的测试用例放在指定目录下,使用discover函数扫描该目录,并根据关键字自动筛选需要执行的用例。本例使用Python3.6版本。1#遍历指定目录,批量执行测试用例2importunittest34case_dir='D:\test_case'567defsuites_run():8'''运行测试套件,批量执行测...

selenium之使用unittest测试框架

1#测试角色权限管理页面功能2fromseleniumimportwebdriver3fromlogin_pageimportLoginPage4importrandom,time,unittest567classTestRole(unittest.TestCase):8defsetUp(self):9self.log...

selenium之截图

selenium支持对当前页面保存截图,使用方法:driver.get_screenshot_as_file(file_path) 代码举例:......defget_screenshot(driver,path=''):'''保存页面截图'''n=0ifpath:passelse:path="D:\test...
代码星球 代码星球·2020-06-13

selenium之调用Javascript

selenium调用Javascript使用方法:driver.execute_script(js)使用JS获取元素文本值,代码片段如下:......js="return$('#searchKey').val()"val=driver.execute_script(js)#调用JavaScript获取输入框的值prin...
代码星球 代码星球·2020-06-13

selenium之下载

#测试下载功能,保存文件到指定的目录#不同的浏览器配置是不同的,本例使用chrome浏览器#author:gongxr#date:2017-07-25importtimefromseleniumimportwebdriverfromlogin_pageimportLoginPage#实例化一个配置对象options=w...
代码星球 代码星球·2020-06-13

selenium之测试卫星资料页面操作(元素遍历)

 #测试气象卫星资料页面功能#author:gongxr#date:2017-07-24importrandom,timefromseleniumimportwebdriverfromlogin_pageimportLoginPagelogin_obj=LoginPage()driver=webdriver....

selenium之测试角色管理页面举例

 #测试角色权限管理页面功能#author:xr#date:2017-07-20fromseleniumimportwebdriverfromlogin_pageimportLoginPageimportrandom,timelogin_obj=LoginPage()driver=webdriver.Chro...

selenium之封装登陆操作

 #selenium封装登录操作举例importos,time#fromseleniumimportwebdriverclassLoginPage():'''登录模块'''def__init__(self,path=''):'''初始化加载驱动'''ifpath:chrome_path=pathelse:ch...

selenium之安装和登陆操作举例

安装selenium:python-mpipinstallselenium-3.4.3-py2.py3-none-any.whl 下载对应浏览器版本的驱动,且在环境变量PATH中指定驱动程序的存放路径,否则需要指定驱动文件路径。代码举例:#selenium登录操作举例importos,timefromsele...

php isset+{} 判断字符串长度比strlen效率高

PHP变量后面加上一个大括号{},里面填上数字,就是指PHP变量相应序号的字符。例如:$str='hello';echo$str{0};//输出为hecho$str{1};//输出为e如果要检查某个字符串是否满足多少长度,可以考虑用这种大括号(花括号)加isset的方式替代strlen函数,因为isset是语言结构,s...

Java 常用对象-Date类和Calender类

2017-11-0222:29:34Date类:类Date表示特定的瞬间,精确到毫秒。在JDK 1.1之前,类Date有两个其他的函数。它允许把日期解释为年、月、日、小时、分钟和秒值。它也允许格式化和解析日期字符串。不过,这些函数的API不易于实现国际化。从JDK 1.1开始,应该使用Calenda...
首页上一页...3536373839...下一页尾页