2

While I am trying to get the value from the text box, it's throwing No such element found issues,

below are my field properties:

input id="altid" class="firstColumnInput text C1 disabled" type="text" value="100281" securityidpath="MEMBER_DEMOGRAPHICS.INDICATIVE_INFORMATION.INDICATIVE_INFORMATION.PERSON.ALT_IDENTIFIER" name="$EntryField$7" lockrequired="true" tabindex="-1" readonly="readonly"

code for getting the value is:

driver.findElement(By.xpath(OR.getProperty(object))).getAttribute("value");

result:

org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"//*[@id=\"age\"]"} For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.2.0', revision: '13073', time: '2011-07-25 19:23:22' System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_22' Driver info: driver.version: EventFiringWebDriver

Please suggest me how to fix this issue.

2 Answers 2

3

try using searching with xpath with the id of the input, something like:

driver.findElement(By.xpath("//*[@id=\"altid\"]")).getAttribute("value");
Sign up to request clarification or add additional context in comments.

Comments

0

It seems like you're looking for any element that has the attribute id = "age". Referenced by,

Unable to locate element: {"method":"xpath","selector":"//*[@id=\"age\"]"}

The id for that specific input seems to be "altid", so you just have to use the proper id value.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.