Different ways to create Xpath for a single Web element
Please find list of ways by using which we can create xpath to identify WebElement in the DOM. Here we have mentioned 15 different xpath for single web element (Society Name) from https://www.societyhive.com //input[@id='txtSocietyName'] //input[@id='txtSocietyName' and @name='societyName'] //input[@id='txtSocietyName' or @name='societyName'] ---Toggle switch //span[text()='Please enter society name']//preceding-sibling::input --------Use of text() method //span[.='Please enter society name']//preceding-sibling::input -----Functionality of
Read more