- For this code need a css-selector, x-path is available
Following is the x-path such as:
//div[@class='item-display-name' and text()='edit']
HTML of the element:
<div class="item-display-name">edit</div>
Following is the x-path such as:
//div[@class='item-display-name' and text()='edit']
HTML of the element:
<div class="item-display-name">edit</div>
To locate the element you need to induce WebDriverWait for the visibility_of_all_elements_located()
and you can use the following css-selectors based Locator Strategy:
element = WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "div.item-display-name")))
Note : You have to add the following imports :
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
As per your comment, No you can't include the text edit within the css-selectors. You can find a detailed discussion in: