Thursday, July 25, 2019

getAttribute value from html when the input tag is disable.

.getAttribute(“textContent”);
This is more important when your application developed with Angular.
When you want to get the test from a WebElement then we will use “.getText”
or any available attribute from the given tag of WebElement. I tried my best but did not get the text from the WebElement from the below code.

>

Both tags are siblings. I want to get a text from input box. input box is editable and it is rendering the value from previous page. But the rendering value of input box is not showing in the “input” tag. it is showing in the “label” tag. If you give the css or xpath for label tag and use the get text then also you are getting the value from the input box.  I tried with many options but no use. i got solution from “stack overflow” and tried with  “.getAttribute(“textContent”); ” then i got the rendering value from input box.

No comments:

Post a Comment