webDriver API——第15部分Expected conditions Support

class selenium.webdriver.support.expected_conditions.alert_is_present

Bases: object

Expect an alert to be present.

class selenium.webdriver.support.expected_conditions.element_located_selection_state_to_be(locatoris_selected)

Bases: object

An expectation to locate an element and check if the selection state specified is in that state. locator is a tuple of (by, path) is_selected is a boolean

class selenium.webdriver.support.expected_conditions.element_located_to_be_selected(locator)

Bases: object

An expectation for the element to be located is selected. locator is a tuple of (by, path)

class selenium.webdriver.support.expected_conditions.element_selection_state_to_be(elementis_selected)

Bases: object

An expectation for checking if the given element is selected. element is WebElement object is_selected is a Boolean.”

class selenium.webdriver.support.expected_conditions.element_to_be_clickable(locator)

Bases: object

An Expectation for checking an element is visible and enabled such that you can click it.

class selenium.webdriver.support.expected_conditions.element_to_be_selected(element)

Bases: object

An expectation for checking the selection is selected. element is WebElement object

class selenium.webdriver.support.expected_conditions.frame_to_be_available_and_switch_to_it(locator)

Bases: object

An expectation for checking whether the given frame is available to switch to. If the frame is available it switches the given driver to the specified frame.

class selenium.webdriver.support.expected_conditions.invisibility_of_element_located(locator)

Bases: object

An Expectation for checking that an element is either invisible or not present on the DOM.

locator used to find the element

class selenium.webdriver.support.expected_conditions.presence_of_all_elements_located(locator)

Bases: object

An expectation for checking that there is at least one element present on a web page. locator is used to find the element returns the list of WebElements once they are located

class selenium.webdriver.support.expected_conditions.presence_of_element_located(locator)

Bases: object

An expectation for checking that an element is present on the DOM of a page. This does not necessarily mean that the element is visible. locator - used to find the element returns the WebElement once it is located

class selenium.webdriver.support.expected_conditions.staleness_of(element)

Bases: object

Wait until an element is no longer attached to the DOM. element is the element to wait for. returns False if the element is still attached to the DOM, true otherwise.

class selenium.webdriver.support.expected_conditions.text_to_be_present_in_element(locatortext_)

Bases: object

An expectation for checking if the given text is present in the specified element. locator, text

class selenium.webdriver.support.expected_conditions.text_to_be_present_in_element_value(locatortext_)

Bases: object

An expectation for checking if the given text is present in the element’s locator, text

class selenium.webdriver.support.expected_conditions.title_contains(title)

Bases: object

An expectation for checking that the title contains a case-sensitive substring. title is the fragment of title expected returns True when the title matches, False otherwise

class selenium.webdriver.support.expected_conditions.title_is(title)

Bases: object

An expectation for checking the title of a page. title is the expected title, which must be an exact match returns True if the title matches, false otherwise.

class selenium.webdriver.support.expected_conditions.visibility_of(element)

Bases: object

An expectation for checking that an element, known to be present on the DOM of a page, is visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0. element is the WebElement returns the (same) WebElement once it is visible

class selenium.webdriver.support.expected_conditions.visibility_of_element_located(locator)

Bases: object

An expectation for checking that an element is present on the DOM of a page and visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0. locator - used to find the element returns the WebElement once it is located and visible

时间: 2024-10-21 08:47:58

webDriver API——第15部分Expected conditions Support的相关文章

<译>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.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;

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

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

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

虫师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

java+selenium3-常用的WebDriver API

常用的WebDriver API 访问某网站 package com.wb.api; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class WebDriverTest { public static void main(String[] args) { WebDriver driver; // 设置浏览器驱动环境变量 System.setProperty

第 4 章 WebDriver API

从本章开始正式学习 WebDriver API,它可用来操作浏览器元素的一些类和方法. 4.1 从定位元素开始 例如百度的首页,页面上有输入框.按钮.文字链接.图片等元素.自动化测试要做的就是模拟鼠标和键盘来操作这些元素,如单击.输入.鼠标悬停等.而操作这些元素的前提是要定位它们.自动化工具,如何定位这些元素呢?通过浏览器自带的(F12)开发者工具可以看到,页面元素都是由 HTML 代码组成的,它们之间有层级地组织起来,每个元素有不同的标签名和属性值.WebDriver 就是根据这些信息来定位元

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