zoukankan      html  css  js  c++  java
  • selenium的一些方法

     

    driver.maximize_window() 最大化浏览器窗口,防止访问url前后都可以
    driver.refresh() 刷新当前页面
    driver.title   获得当前页面的标题

    定位方式
    1. 通过id定位元素:find_element_by_id("id_vaule")
    2. 通过name定位元素:find_element_by_name("name_vaule")
    3. 通过tag_name定位元素:find_element_by_tag_name("tag_name_vaule")
    4. 通过class_name定位元素:find_element_by_class_name("class_name")
    5. 通过css定位元素:find_element_by_css_selector()
    6. 通过xpath定位元素:find_element_by_xpath("xpath")
    7. 通过link:find_element_by_link_text("text_vaule")
    8. 通过find_element_by_partial_link_text()
    find_element_by_link_text 根据文本内容定位,标签必须是<a></a>的元素
  • 相关阅读:
    Game Engine Architecture 3
    Game Engine Architecture 2
    补码
    工厂模式
    Game Engine Architecture 1
    YDWE Keynote
    3D Math Keynote 4
    3D Math Keynote 3
    3D Math Keynote 2
    OGRE中Any 类型的实现
  • 原文地址:https://www.cnblogs.com/hemengjita/p/12546896.html
Copyright © 2011-2022 走看看