While automating a website for testing there is always required to perform some right-click or other user actions on the page. These user actions are one of the most commonly used actions during automation, so selenium provides a way to perform these user actions by the Actions class.
When a user performs a right click using the mouse on a particular element to perform some actions is called a right click. We are daily using this user action mostly on File Explorer, For example, to rename a file or delete a file we perform right-click and select an option.
Using the #ContextClick() method” from the Actions class to perform the Right click. Context Click methods navigate the mouse pointer to the middle of the web Element and then perform the right-click action in that web element.
action.contextClick(webElement).perform();
Below are the steps which will be automated in this video-
1) Access https://swisnl.github.io/jQuery-conte...
2) Right click on "right click me" button
3) Click on Quit webelement present on rightclicked dialog.
4) Accept the alert.
#framework #selenium #contextclick #rightclick #actionsapi #actionclassinselenium
Watch video Perform Right Click using Java in Selenium Webdriver online without registration, duration hours minute second in high quality. This video was added by user SDET Adda For QA Automation 04 February 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 767 once and liked it 29 people.