If the element has two xpath, then you can write two xpaths like below
xpath1 | xpath2
Eg: //input[@name="username"] | //input[@id="wm_login-username"]
It will choose any one xpath
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?
- Locating an element by id
- Selenium xpath selector based on the element text
- Which Firefox browser versions supported for given Geckodriver version?
- XPath: difference between dot and text()
- Invalid selector: Compound class names not permitted error using Selenium
- How to capture the screenshot of a specific element rather than entire page using Selenium Webdriver?
- How to run Selenium WebDriver test cases in Chrome
- Exception in thread “main” org.openqa.selenium.NoSuchElementException: Unable to locate element: //*[@id=’login-email’]
- Load chrome extension using selenium
- Selenium WebDriver zoom in/out page content
- Reached error page: about:neterror when trying to navigate to other tabs if there is a form submit under that tab
- Tests fail immediately with unknown error: DevToolsActivePort file doesn’t exist when running Selenium grid through systemd
- How to install extension permanently in geckodriver
- org.openqa.selenium.ElementNotInteractableException: Element could not be scrolled into view when trying to click a button
- using http proxy with selenium Geckodriver
- Why should I ever use CSS selectors as opposed to XPath for automated testing?
- Difference of Headless browsers for automation
- org.openqa.selenium.InvalidCookieDomainException: Document is cookie-averse using Selenium and WebDriver
- I need to find an element in Selenium by CSS
- selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80
- How to deal with ModalDialog using selenium webdriver?
- How to switch control from child window to parent window in selenium webdriver?
- Is string matches() supported in Selenium Webdriver 2?
- How to click on Load More button within Google Trends and print all the titles through Selenium and Python
- Only local connections are allowed Chrome and Selenium webdriver