Clicking Element with JavaScript on Robot Framework

Asanka Vithanage
1 min readJun 5, 2019

Robot framework provides keyword called Execute JavaScript to execute JavaScript codes.

Below code will find the element with provided id value and click on it

Execute JavaScript document.getElementById(‘ID Value’).onclick()

Ex. Execute JavaScript document.getElementById(‘main-header’).onclick()

Below code will find the element with provided xpath value and click on it

Execute JavaScript document.evaluate(‘xpath…

--

--

Asanka Vithanage

Software Quality Assurance Professional, Problem Solver, SOA Tester, Automation Engineer, CI/CD Practitioner, DevOps enthusiast