This is the html line for field I am trying to locate:
<input class="textbox" name="txtUserLoginID" maxlength="25" value="" type="text"/>
My XPath is:
WebElement username = driver.findElement(By.xpath(
"html/body/form/table/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[2]"
+ "/td/table/tbody/tr/td/table/tbody/tr/td[6]/table/tbody/tr/td[2]/table/tbody/tr[3]/td/table/tbody/tr[1]/td/table"
+ "/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr[1]/td[3]/input"));
but it seems to not be working after that.
I have tried click()
and sendKeys()
functions, but neither works. I have tried using name and class but nothing works.
Using:
- Selenium: v3.4
- Firefox: v53
error:
{Using=xpath, value=//input[@name='txtUserLoginID'][@type='text']}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)