WebUI.mouseOver(findTestObject(‘Object Repository/Page_SDS Wind-Log/div_Total Power Lost_pieContainer’))
attribute = WebUI.getAttribute(findTestObject(‘Object Repository/Page_SDS Wind-Log/div_Total Power Lost_pieContainer’),
‘style’)
println(attribute)
It returns blank value when 'style is used and it returns ‘null’ value when class attribute is used.
@Team: Could you please look into it and help me resolve this issue or provide an input on which attribute to use in order to fetch text after mouse over.
Sorry, but I find your question quite confusing. I am going to show you how to retrieve the innerText from the <bs-tooltip-container> element even though your screenshot shows the <canvas> element is selected.
To retrieve the innerText of any HTML element, use WebUI.getText()
Here is the relevant part of your screenshot. You highlighted a comment. I think I need to see the element I circled in red. Click that little arrow. If there are more elements inside, keep opening them until we find your target with “26%”.
If you can’t find it, then we’re looking at the wrong element.
The moment cursor is moved out of pie chart, the circled element which you have asked for vanishes. Therefore, i am not able open it till the last element.
Yes. More than one. Your issue is going to be ensuring only the target tooltip is visible and present in the DOM. If you use your hover code, I’m hoping we have covered that potential issue.
The screenshot you provided did not cover the complete path to the tooltip. In fact, it contains LESS html.
Even so, let’s give this a shot: Add this code to your test case AFTER you have positioned the mouse. Make sure also the tooltip is visible BEFORE this code is executed…
String js = '''
var selector = "bs-tooltip-container div.tooltip-inner";
return document.querySelector(selector).innerText;
'''
String text = WebUI.executeJavaScript(js, null)
println("The tooltip text is: " + text)