What is difference between WebDriver click() and JavaScript click()?

Member

by sidney , in category: Technology , 3 years ago

What is difference between WebDriver click() and JavaScript click()?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by irwin , 3 years ago

WebDriver click() simulates real user interaction with the UI. I will be performed (in most browsers) by sending a native event to the browser, and it has to be visible in order to click on it.

JavaScript click() on the other hand, executes JavaScript in the context of the currently selected frame or window.

Note: Regardless if the WebElement is visible or not. This approach misses the idea of user interaction Selenium tries to simulate.