The click function using xpath parameter to click to the element, so if you have the xpath just write the code as below:
Basically, when you execute this function the code will get the xpath you provide and find the element then it will execute actual click to this element.
For example, I go to the website http://www.google.com.vn, I enter "test" for keyword and then right click to the button "Tìm với Google", this will get the xpath of this button and show the function in the developer tool.
This is the result when you choose "Click" and select "Element"
Click Run you will see browser will navigate you to search the "test" keyword in google
By using this tool, you can simulate click on any element such as: link, button,... in any website. I will show you how to navigate to the website and click to link automatically.
Use this code to navigate to website "New York Times", wait exactly 15 seconds before click to the politics category on this site:
Next tutorial, I will show you how to simulate file upload by using web automation tool.