How to click a link using its xpath

I want to click a web link using its xpath.

The following link uses the object name
WebUI.click(findTestObject(‘Page Title/a_link_name’))
It works well if the page title is correct.

I do not want to use the page title, but something similar to below

WebUI.click(findTestObject(<link=LinkTitle>))
OR
WebUI.click(findTestObject())

Please help. I am new to Katalon

Thanks.

You just need to open up your ‘Page Title/a_link_name’ object properties and change the selection method to use xpath. Then it will use the xpath you set to select the object rather than the title text or whatever you have it set to use currently.

1 Like

1. Get your link xpath(can get from chrome browser)
2. Create Object on object repository
3. Use xpath identifier
4. Use it for click action

1 Like

Robert Harvey said:

You just need to open up your ‘Page Title/a_link_name’ object properties and change the selection method to use xpath. Then it will use the xpath you set to select the object rather than the title text or whatever you have it set to use currently.

Thanks.

Didit Setiawan said:

1. Get your link xpath(can get from chrome browser)
2. Create Object on object repository
3. Use xpath identifier
4. Use it for click action

Thanks.