
selenium python
jody_xx
这个作者很懒,什么都没留下…
展开
-
python执行某一目录下所有.py结尾的文件,并将执行结果保存到log.txt文档。一般用于批量执行测试。
python执行某一目录下所有.py结尾的文件,并将执行结果保存到log.txt文档。一般用于批量执行测试。import osimport subprocesscaselist=os.listdir('D:\\Program Files\\python\\test_case')for a in caselist: s=a.split('.')[1]原创 2017-04-13 13:25:59 · 3995 阅读 · 0 评论 -
selenium python截图函数
webdriver的get_screenshot_as_file()函数截图当前页面并保存到指定的路径下面#coding=utf-8from selenium import webdriverdriver=webdriver.Firefox()driver.get('http://www.baidu.com')try: driver.get_element_by_id(...原创 2018-10-24 14:43:40 · 969 阅读 · 0 评论 -
python selenium自动化测试博客
https://www.cnblogs.com/mengyu/category/950040.html转载 2018-10-26 11:16:45 · 168 阅读 · 0 评论 -
python selenium 定位iframe中的元素,进入iframe,需要返回
from selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.common.keys import Keysfrom selenium.webdriv...原创 2018-10-23 10:32:07 · 3928 阅读 · 0 评论 -
Python中有一个自带的单元测试框架是unittest模块
Python中有一个自带的单元测试框架是unittest模块,用它来做单元测试,它里面封装好了一些校验返回的结果方法和一些用例执行前的初始化操作。在说unittest之前,先说几个概念:TestCase 也就是测试用例TestSuite 多个测试用例集合在一起,就是TestSuiteTestLoader是用来加载TestCase到TestSuite中的TestRunner是来执...转载 2018-10-25 10:27:52 · 1073 阅读 · 0 评论 -
selenium3 python3 示例
#coding=utf-8from selenium import webdriverfrom selenium.webdriver.common.keys import Keysimport timefrom selenium.webdriver.support.ui import WebDriverWaitdriver=webdriver.Firefox(executable_path='ge...原创 2018-07-13 18:01:32 · 521 阅读 · 0 评论 -
python3.6 selenium3.13.0 firefox61.0.1环境配置成功了
python3.6 selenium3.13.0 firefox61.0.1环境配置成功了一直担心的不兼容问题好像没有出现selenium3 要支持firefox先要下载geckodriver放到python目录下,python路径要在系统环境变量path里面配置环境配置是否成功测试代码:(成功启动了firefox)from selenium import webdriverfrom seleni...原创 2018-07-13 15:27:39 · 932 阅读 · 0 评论 -
python连接oracle数据库之安装cx_Oracle
网上找到的方法,前提是安装了pip工具Use Python’s Pip package to install cx_Oracle from PyPI:python -m pip install cx_Oracle --upgradepython安装Django 2.0.2方法:菜鸟译站教程有相关方法。http://www.runoob.com/django/django-install.html...原创 2018-02-09 17:09:47 · 801 阅读 · 0 评论 -
python 连接 oracle的一个小例子
#!/usr/bin/python#conding=utf-8#import moduleimport cx_Oracle as oracledb=oracle.connect('user/password@192.168.0.103:1521/orcl')cursor=db.cursor()cursor.execute("select * from student")rs=cursor.fetc...原创 2018-02-11 15:17:34 · 5145 阅读 · 0 评论 -
pip安装包下载地址
https://pypi.python.org/pypi/pip#downloads原创 2017-12-20 11:03:10 · 28393 阅读 · 0 评论 -
终于成功安装了win7 64位pygame
终于成功安装了win7 64位pygame,主要是找到64位的.whl文件了。然后安装方法网上很多。不过,安装时,安装文件放在哪个目录是无关紧要的。开始也以为跟安装文件放的位置有关,于是自己在python的安装目录下建了一个pygame文件夹,其实是没用的。只要安装时,cmd先到安装文件所在的目录就行。验证是否安装成功时,要重启python IDE,否则会报错。哈哈,我就是因为pyth原创 2017-04-01 14:42:26 · 5518 阅读 · 0 评论 -
安装python的第三方库pillow
安装python的第三方库pillow2016-07-11 16:58 by sophia194910, 222 阅读, 0 评论, 收藏, 编辑参考:http://jingyan.baidu.com/article/ff42efa929e6c8c19f220254.html用Python做图像处理时,需要用到PIL(图像处理库)。但是PIL已停止更新,而Pillow是对PIL转载 2017-04-05 10:58:22 · 19232 阅读 · 1 评论 -
selenium多个窗口之间的切换(浏览器窗口)
from selenium import webdriverd=webdriver.Firefox()d.get("http://www.baidu.com")d.find_element_by_id('kw').clear()d.find_element_by_id('kw').send_keys('麦子学院')d.find_element_by_id('su').click...原创 2018-11-19 17:12:45 · 1988 阅读 · 0 评论