美文网首页
Find page elements and navigatio

Find page elements and navigatio

作者: cutelittlePanda | 来源:发表于2017-05-30 18:59 被阅读0次

    .. to a link: driver.get("link_url")

    .. interacting with the page, find elements: 

    1. find one:  find_element_by_xx.....

    2. find more: find_elements_by_xx...

                use:  for element_name in all_elements_found: 

                                print("Value is: %s", element_name.get_attribute("value"))

                 to output the values.

    .. driver.switch_to_fram("iframe_name")

    ..drag_and_drop:    from selenium.webdriver import ActionChains

                                    action_chains = ActionChains(driver)

                                     action_chains.drag_and_drop(element, target).perform()

    .. driver.switch_to_window("window_name")

    .. driver.switch_to_frame("frameName.0.childName"):

                                             would go to the frame named “childName” of the first subframe of the frame called “frameName”. All frames are evaluated as if from *top*.

    .. Back to the parent frame:  driver.switch_to_default_content()

    3. Frequently used methods

    相关文章

      网友评论

          本文标题:Find page elements and navigatio

          本文链接:https://www.haomeiwen.com/subject/kcbrfxtx.html