I\'ve been through the xpath tutorials and checked many other posts, hence I\'m not sure what I\'m missing. I\'m simply trying to find the following element by xpath:
Just need to add * at the beginning of xpath and closing bracket at last.
*
element = findElement(By.xpath("//*[@test-id='test-username']"));
You can use contains too:
element = findElement(By.xpath("//input[contains (@test-id,"test-username")]");