I think this is what you are looking for
ul/li[contains(text(), "Second")]
and better still
ul/li[text() = 'Second']
More Related Contents:
- How to click on SVG elements using XPath and Selenium WebDriver through Java
- What is the difference between cssSelector & Xpath and which is better with respect to performance for cross browser testing?
- Creating XPATH for svg tag
- What is the difference between a CSS selector and XPath? And which is better with respect to performance for cross-browser testing?
- What is the difference between a CSS and XPath selector? And which is better with respect to performance for cross-browser testing?
- Using an OR condition in Xpath to identify the same element
- Locating an element by id
- StaleElementReference Exception in PageFactory
- How does chrome driver interact with Chrome browser?
- How can I take a screenshot with Selenium WebDriver?
- What is the difference between .// and //* in XPath?
- Selenium: How selenium identifies elements visible or not? Is is possible that it is loaded in DOM but not rendered on UI?
- Selenium WebDriver 3.4.0 + geckodriver 0.18.0 + Firefox ?? – which combination works?
- Error [SEVERE]: Timed out receiving message from renderer: 20.000 while executing the testsuite through Selenium on Jenkins
- Page load strategy for Chrome driver (Updated till Selenium v3.12.0)
- Unable to find a matching set of capabilities with selenium 3.4.3, firefox 54.0 and gecko driver 0.17
- release Selenium chromedriver.exe from memory
- SyntaxError: Failed to execute ‘evaluate’ on ‘Document’: The string ‘//img[contains(‘1236548597′)]’ is not a valid XPath expression
- How to turn off w3c in chromedriver to address the error unknown command: Cannot call non W3C standard command while in W3C
- How to click on the reCAPTCHA using Selenium and Java
- What is the internal working difference between Implicit Wait and Explicit Wait
- ERROR:ssl_client_socket_openssl.cc(1158)] handshake failed with ChromeDriver Chrome browser and Selenium
- Selenium Grid: MaxSessions vs MaxInstances
- Cannot get automation extension from timeout: Timed out receiving message from renderer
- Selenium Webdriver wait Expected condition failed: waiting for visibility of element located by By.id
- Is it Firefox or Geckodriver, which creates “rust_mozprofile” directory
- Find an element by text and get xpath – selenium webdriver junit
- Is there a Selenium WebDriver available for the Microsoft Edge browser?
- selenium implicitly wait doesn’t work
- How to run Selenium tests on the Brave web browser?