I am a newbie and I am developing a test automation in Robot Framework and it needs to select the parent div but the child div is the one that is always click.
this is my RF code:
Wait and click element xpath: //div[contains(@class,'parent') and .='orange']
And this is the HTML
<div >
orange
<div ></div>
</div>
I want TA not to click the div.child. Is there any way to do this?
CodePudding user response:
try
Wait and click element xpath://*[contains(text(),'orange')]
CodePudding user response:
Execute Javascript $('.parent').click()
update your loctors based on your requirements.