Hello,
I’m trying to verify a tooltip in an Angular website. Its not possible to acess this tooltip with the Object Spy.
The tooltip is created via a message-name.
The following part contains the reference to the message → “cdk-describedby-message-15”
<a class="id_link_label_linkvalue ng-star-inserted" rel="noreferrer" target="_blank" aria-describedby="cdk-describedby-message-15" cdk-describedby-host="" href="https://abcdefg.xy">II/2 </a>
At the end of the DOM there ist a DIV-section with the text of the message named cdk-describedby-message-15.
<div id="cdk-describedby-message-container" aria-hidden="true" style="display:
none;">
<div id="cdk-describedby-message-0">Drucken</div>
<div id="cdk-describedby-message-15">Freigabe am: 26.08.2016</div>
<div id="cdk-describedby-message-16">Finalisierung am: 26.09.2016</div>
</div>
In my testcase I pick up the message name sucessfully via getAttribute
String msgName = WebUI.getAttribute(findTestObject('Institutsanzeige/FKRPGesamtnote/BBk1'), 'aria-describedby')
In the repository I’ve defined a dummy-object ToolTip1 with object property xpath equals //*[@id="${msgTT}"]
In my testcase I replace the parameter with the message name “cdk-describedby-message-15”
The verifyElementPresent was sucessful
WebUI.verifyElementPresent(findTestObject('Institutsanzeige/FKRPGesamtnote/ToolTip1', [('msgTT') : msgName]), 3)
10-15-2018 10:21:41 AM - [START] - Start action : verifyElementPresent
10-15-2018 10:21:41 AM - [INFO] - Finding Test Object with id 'Object Repository/Institutsanzeige/FKRPGesamtnote/ToolTip1'
10-15-2018 10:21:41 AM - [INFO] - Checking object
10-15-2018 10:21:41 AM - [INFO] - Checking timeout
10-15-2018 10:21:41 AM - [INFO] - Finding web element with id: 'Object Repository/Institutsanzeige/FKRPGesamtnote/ToolTip1' located by 'By.xpath: //*[@id="cdk-describedby-message-15"]' in '3' second(s)
10-15-2018 10:21:41 AM - [INFO] - Found 1 web elements with id: 'Object Repository/Institutsanzeige/FKRPGesamtnote/ToolTip1' located by 'By.xpath: //*[@id="cdk-describedby-message-15"]' in '3' second(s)
10-15-2018 10:21:41 AM - [PASSED] - Object 'Object Repository/Institutsanzeige/FKRPGesamtnote/ToolTip1' is present
10-15-2018 10:21:41 AM - [END] - End action : verifyElementPresent
Attention! Forum software does not show the whole xpath expression.
But if I try to access the message-text its empty
println(WebUI.getText(findTestObject('Institutsanzeige/FKRPGesamtnote/ToolTip1', [('msgTT') : msgName])))
10-15-2018 10:21:41 AM - [INFO] - Finding web element with id: 'Object Repository/Institutsanzeige/FKRPGesamtnote/ToolTip1' located by 'By.xpath: //*[@id="cdk-describedby-message-15"]' in '15' second(s)
10-15-2018 10:21:41 AM - [INFO] - Found 1 web elements with id: 'Object Repository/Institutsanzeige/FKRPGesamtnote/ToolTip1' located by 'By.xpath: //*[@id="cdk-describedby-message-15"]' in '15' second(s)
10-15-2018 10:21:41 AM - [INFO] - Getting text of object 'Object Repository/Institutsanzeige/FKRPGesamtnote/ToolTip1'
10-15-2018 10:21:41 AM - [PASSED] - Text of object 'Object Repository/Institutsanzeige/FKRPGesamtnote/ToolTip1' is: ''
I’ve also tried two other approaches wich I found in the forum and they are basically working but none of them gives me the messagetext if I use getText.
String newXpath = ('//*[@id="' + msgName) + '"]'
TestObject new_TT = WebUI.modifyObjectProperty(findTestObject('Institutsanzeige/FKRPGesamtnote/ToolTip1'), 'xpath', 'equals', newXpath, true)
TestObject dynamicObject = new TestObject('dynamicObject').addProperty('xpath', com.kms.katalon.core.testobject.ConditionType.EQUALS,
newXpath, true)
Has anyone a hint?