webDriver API——第13部分UI Support

class selenium.webdriver.support.select.Select(webelement)
deselect_all()

Clear all selected entries. This is only valid when the SELECT supports multiple selections. throws NotImplementedError If the SELECT does not support multiple selections

deselect_by_index(index)

Deselect the option at the given index. This is done by examing the “index” attribute of an element, and not merely by counting.

Args:
  • index - The option at this index will be deselected
deselect_by_value(value)

Deselect all options that have a value matching the argument. That is, when given “foo” this would deselect an option like:

<option value=”foo”>Bar</option>

Args:
  • value - The value to match against
deselect_by_visible_text(text)

Deselect all options that display text matching the argument. That is, when given “Bar” this would deselect an option like:

<option value=”foo”>Bar</option>

Args:
  • text - The visible text to match against
select_by_index(index)

Select the option at the given index. This is done by examing the “index” attribute of an element, and not merely by counting.

Args:
  • index - The option at this index will be selected
select_by_value(value)

Select all options that have a value matching the argument. That is, when given “foo” this would select an option like:

<option value=”foo”>Bar</option>

Args:
  • value - The value to match against
select_by_visible_text(text)

Select all options that display text matching the argument. That is, when given “Bar” this would select an option like:

<option value=”foo”>Bar</option>

Args:
  • text - The visible text to match against
all_selected_options

Returns a list of all selected options belonging to this select tag

first_selected_option

The first selected option in this select tag (or the currently selected option in a normal select)

options

Returns a list of all options belonging to this select tag

class selenium.webdriver.support.wait.WebDriverWait(drivertimeoutpoll_frequency=0.5ignored_exceptions=None)

Bases: object

until(methodmessage=‘‘)

Calls the method provided with the driver as an argument until the return value is not False.

until_not(methodmessage=‘‘)

Calls the method provided with the driver as an argument until the return value is False.

时间: 2024-12-28 08:15:20

webDriver API——第13部分UI Support的相关文章

webDriver API——第14部分Color Support

class selenium.webdriver.support.color.Color(red, green, blue, alpha=1) Bases: object Color conversion support class Example: from selenium.webdriver.support.color import Color print(Color.from_string('#00ff33').rgba) print(Color.from_string('rgb(1,

selenium之WebDriver API

自动化只要掌握四步操作:获取元素,操作元素,获取返回结果,断言(返回结果与期望结果是否一致),最后自动出测试报告,元素定位在这四个环节中是至关重要的,如果说按学习精力分配的话,元素定位占70%:操作元素10%,获取返回结果10%:断言10%.如果一个页面上的元素不能被定位到,那后面的操作就无法继续了.而WebDriver 属于Selenium体系设计出来操作浏览器的一套API,它支持多种语言,Selenium WebDriver只是python的一个第三方框架,也就是说是一个实现web自动化的第

Webdriver API (二)

(转载) 1.3 打开测试页面 对页面对测试,首先要打开被测试页面的地址(如:http://www.google.com),web driver 提供的get方法可以打开一个页面: // And now use thedriver to visit Google driver.get("http://www.google.com"); 1.4   例子 package org.openqa.selenium.example; import org.openqa.selenium.By;

&lt;译&gt;Selenium Python Bindings 6 - WebDriver API

本章涉及Selenium WebDriver的所有接口. Recommended Import Style 推荐的导入风格如下: from selenium import webdriver 然后,你可以这样访问所有的类: webdriver.Firefox webdriver.FirefoxProfile webdriver.Chrome webdriver.ChromeOptions webdriver.Ie webdriver.Opera webdriver.PhantomJS webdr

webdriver API中文文档

1.1   下载selenium2.0的lib包 http://code.google.com/p/selenium/downloads/list 官方UserGuide:http://seleniumhq.org/docs/ 1.2   用webdriver打开一个浏览器 我们常用的浏览器有firefox和IE两种,firefox是selenium支持得比较成熟的浏览器.但是做页面的测试,速度通常很慢,严重影 响持续集成的速度,这个时候建议使用HtmlUnit,不过HtmlUnitDirver

Selenium中WebDriver API的使用(三)

WebDriver API中常用的方法和属性 方法: clear() --->清除一个文本输入框 p:driver.find_element_by_id("kw").clear() send_keys()  -->来输入字符串 p:driver.find_element_by_id("kw").send_keys("Selenium") click() -->点击页面上支持点击的元素 driver.find_element_by

Selenium2+Python:Webdriver API速记手册

由于web自动化常常需要控制浏览器行为和操作页面元素,相关函数又比较多,于是再此记下一份Webdriver API查阅文档以备不时之需. 参考:虫师<Selenium2自动化测试实战>,和http://selenium-python.readthedocs.io/api.html 1 #coding=utf-8 2 from selenium import webdriver 3 driver=webdriver.Firefox() 4 driver.get('http://www.baidu

Java程序员的JavaScript学习笔记(13—— jQuery UI)

计划按如下顺序完成这篇笔记: 1. 理念. 2. 属性复制和继承. 3. this/call/apply. 4. 闭包/getter/setter. 5. prototype. 6. 面向对象模拟. 7. jQuery基本机制. 8. jQuery选择器. 9. jQuery工具方法. 10. jQuery-在"类"层面扩展. 11. jQuery-在"对象"层面扩展. 12. jQuery-扩展选择器. 13. jQuery UI. 14. 扩展jQuery UI

虫师Selenium2+Python_4、webdriver API

大纲 P70——WebDriver API P83——控制浏览器 P86——简单元素操作 P92——键盘事件和获得验证信息(预期结果) P95——设置元素等待:显示等待和隐式等待 P100——定位一组元素 P104——多表单切换 P106——多窗口切换 P108——警告框处理 P110——上传文件 P116——下载文件 P117——操作cookie P120——调用JavaScript P123——处理HTML5的视频播放 P124——窗口截图 P125——关闭窗口和验证码处理 P128——We