简体   繁体   中英

From which place Selenium Webdriver gets title - using driver.title

From which place Selenium Webdriver usually gets title - using driver.title ?

  • from Page Source
  • or from DOM structure

title

title returns the title of the current page.

  • Usage:

     title = driver.title 
  • Defination:

     def title(self): """Returns the title of the current page. :Usage: title = driver.title """ resp = self.execute(Command.GET_TITLE) 
  • Details: When you invoke driver.title the HTTP GET request is invoked through the /session/{session id}/title URI Template .

NOTE : This command returns the document title of the current top-level browsing context, equivalent to calling document.title .

  • The remote end steps are:
    • If the current top-level browsing context is no longer open, return error with error code no such window.
    • Handle any user prompts and return its value if it is an error.
    • Let title be the result of calling the algorithm for getting the title attribute of the current top-level browsing context's active document.
    • Return success with data title.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM