I'm regularly hitting odd visible page text that karate cannot see, likely due to some funky JS magic that I don't fully understand.
Example image shows text on the page generated after clicking on a translate button:
I'm trying to assert that the translated text is present and correct on the page.
This is the selector:
#results-panel > div > div > div.thread > div > div.activity.panel.panel-default > div.panel-content > div > div:nth-child(2) > div:nth-child(1) > div > div.analysedText-translation > div > span:nth-child(3)
Example snippet of the element:
Using the wildcard {} or {^} doesn't work. eg waitFor('{^}A few random things about cats') returns a null
I played around with CSS selectors and am able to highlight the text using:
- highlight('.analysedText-translation > div > span:nth-child(3)')[0]
I was thinking maybe using waitForText but not sure how to apply it. Any suggestions?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…