How to use Execute Javascript keyword in robot framework for clicking an element

Issue

I need to click a button whose xpath is “//input[contains(@value,’Export to Excel’)]” through Execute Javascript keyword. I don’t know how to use it.

Can anyone help me out!!!

Solution

You can write it as below

Execute JavaScript    document.evaluate("ur xpath",document.body,null,9,null).singleNodeValue.click();

Answered By – Krishna Kokila

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published