zoukankan      html  css  js  c++  java
  • WebDriver API——第1部分

    The API definitions in this chapter shows the absolute location of classes. However the recommended import style is as given below:

    from selenium import webdriver
    

    Then, you can access the classes like this:

    webdriver.Firefox
    webdriver.FirefoxProfile
    webdriver.Chrome
    webdriver.ChromeOptions
    webdriver.Ie
    webdriver.Opera
    webdriver.PhantomJS
    webdriver.Remote
    webdriver.DesiredCapabilities
    webdriver.ActionChains
    webdriver.TouchActions
    webdriver.Proxy
    

    The special keys class (Keys) can be imported like this:

    from selenium.webdriver.common.keys import Keys
    

    The exception classes can be imported like this (Replace the TheNameOfTheExceptionClass with actual class name given below):

    from selenium.common.exceptions import [TheNameOfTheExceptionClass]
    

    Conventions used in the API

    Some attributes are callable (or methods) and others are non-callable (properties). All the callable attributes are ending with round brackets.

    Here is an example for property:

    • current_url

      URL of the current loaded page.

      Usage:

      driver.current_url
      

    Here is an example for a method:

    • close()

      Closes the current window.

      Usage:

      driver.close()
  • 相关阅读:
    近期学习情况
    java连接数据库的两种方法总结
    近两个星期学习成果
    云笔记第一阶段总结
    圆面积
    C++计算器项目的初始部分
    C++视频课程
    A+B Format
    大一下学期的自我目标
    Kohana的请求流
  • 原文地址:https://www.cnblogs.com/hushaojun/p/4467279.html
Copyright © 2011-2022 走看看