基于Python ddt, selenium数据驱动测试实例1...
分类:
编程语言 时间:
2015-04-30 14:13:48
阅读次数:
2055
Selenium处理模态对话框问题描述: 点击按钮出现一个模态对话框,代码会卡在click这步不继续执行。原因是Selenium目前没有提供对模态对话框的处理。 解决方案: 将click出现弹出框这步用JS代替执行,然后切换到弹出窗就可以继续操作页面元素了。 测试地址:https://develo....
分类:
其他好文 时间:
2015-04-30 10:26:19
阅读次数:
126
classselenium.webdriver.support.color.Color(red,green,blue,alpha=1)Bases:objectColor conversion support classExample:from selenium.webdriver.support.c...
classselenium.webdriver.firefox.webdriver.WebDriver(firefox_profile=None,firefox_binary=None,timeout=30,capabilities=None,proxy=None)Bases:selenium.we...
The API definitions in this chapter shows the absolute location of classes. However the recommended import style is as given below:from selenium impor...
The Utils methods.selenium.webdriver.common.utils.free_port()Determines a free port using sockets.selenium.webdriver.common.utils.is_connectable(port)...
python 安装python 下载地址:http://python.org/getit/ez_setup.py下载地址:https://pypi.python.org/packages/source/e/ez_setup/ez_setup-0.9.tar.gz环境变量配置:path C:\P...
分类:
编程语言 时间:
2015-04-28 20:40:16
阅读次数:
138
找不到元素这个问题困扰了两天了,一直怀疑是页面div层次太多,定位不准确。于是就从table开始到最后一层精确定位,仍然找不元素。怎么办,在网上搜索答案,说是可以加个隐式试试,于是在执行前加了一句等待driver.manage().timeouts().implicitlyWait(50, Time...
分类:
其他好文 时间:
2015-04-28 13:39:10
阅读次数:
210
在selenium2library库的open browser中,除了我们常用的url,browser外,还有几个不常用的参数。如:remote_url的用法1.下载selenium-server-standalone-XXXX.jar包https://code.google.com/p/selen...
分类:
其他好文 时间:
2015-04-27 19:44:11
阅读次数:
138
可以用 execute_script方法来处理这个。 调用原生javascript的API,这样你想滚到哪里就能滚到哪里。下面的代码演示了如何滚到页面的最下面:driver.execute_script("window.scrollTo(0, document.body.scrollHeight);...
分类:
编程语言 时间:
2015-04-27 13:01:20
阅读次数:
1839