Search Posts

Category: robotframework

Why I can’t get the text for this element

I am trying to test some search function in a webpage. and if no result return, the page shows text “no result“. I can see the text, but my test code can’t get the value. I tried document.querySelector(“div[class=’bold ng-binding’]”).text; document.querySelector(“div[class=’bold ng-binding’]”).innerHTML; document.querySelector(“div[class=’bold ng-binding’]”).value; Nothing works. it always returns “None”. The Element looks like this: <div ng-show=”expanded && !show” class=”bold ng-binding”>No Result</div> Source: AngularJS