Locating elements

  • ChroPath Chrome plugin, SelectorsHub Chrome plugin
  • Locating elements https://selenium-python.readthedocs.io/locating-elements.html#locating-elements
    1. image
      image
    2. OR elem = driver.find_element_by_name("q")
    3. XPath is the language used for locating nodes in an XML document.
      • It is based on the DOM structure (Document object model), we see HTML in a node structure, parent, child, in a heirarchy.
    4. If element is not found in case of find_element Exception will be thrown
      • in case of find_elements as it returns the collection it will return 0
    5. close() - closes the window, and WebDriver sission still running, quit() - for quitting speficic browser
    6. getWindowHandle() returns the window handle of currently focused window/tab getWindowHandles() returns all windows/tabs handles launched/opened by same driver instance including all parent and child window.
SuperMade with Super