On the project I’m currently working on, I need to save the value of a TextBox in a variable. However, maybe due to the fact it’s disabled, it’s harder than expected.
Here’s the TextBox in question:
I’ve tried:
- String NoDS = WebUI.getText(findTestObject([path to object])): gives me a null value
- String NoDS = WebUI.getAttribute(findTestObject([path to object]), ‘value’): fails with a StaleElementException saying “element is not attached to the page document”.
- String NoDS = WebUI.getAttribute(findTestObject([path to object]), ‘title’): fails with a StaleElementException giving the same message as above.
Of course, all of these have been tested in Chrome, Firefox and IE. No difference in behavior.
The page is dynamically created with Spring. So maybe that’s why the TextBox is giving me issues. But I’m able to get the value of other TextBoxes just not that one. Am I doing something wrong?