LEAPWORK has different building blocks to interact with web page elements. But sometimes due to some issues in the application, the interaction with web elements does not work as expected.
In order to mend this situation, there is a workaround which can be used as an alternative to using the regular building blocks like Click Web Element ,Get Web Text etc.
Here we have utilized the CSS Selector for finding the element and the command goes by :
Similarly, some other methods would be :
1.Since document.getElementsByClassName/document.getElementsByTagName returns an array-like object of all the child elements which have all of the given class names/tag names, you need to define the index to perform any operation as used above i.e clicking first element in the array.
You can use the innerText property to extract the text contained in the particular element.The innerText property returns the text content of the specified node, and all its descendants.
Eg. return document.getElementById("myBtn").innerText;
The return statement returns the text selected and which can be captured by any subsequent block from the result node.Here we have used the text as a log message in the image above.
Note : Please use the "Result as" field with "Text" value, otherwise it will lead to errors.
For any clarification, please contact our Priority Support.