Skip to content

10. Link Text and Partial Link Text

NaveenS edited this page Aug 26, 2019 · 4 revisions

Links can be accessed using an exact or partial match of their link text. The examples below provide scenarios where multiple matches would exist and would explain how WebDriver would deal with them.

find_element_by_link_text()

driver.find_element_by_link_text("Forgot your password ?")

find_element_by_partial_link_text()

driver.find_element_by_partial_link_text("Forgot")

Refer forgetpassword_scenario.py

Q&A:

Is find_element_by_link_text and find_element_by_partial_link_text are Case-sensitivity check

Yes, The parameters for find_element_by_link_text() and find_element_by_partial_link_text() are both case-sensitive, meaning that capitalization matters

Clone this wiki locally