I have a product listing page with 1-n products there. Unfortunately the source is not really automation friendly, means, all products on the listing are equal regarding html attributes. The only way they differ are the prices and of course the product names.
The source looks like this (abstract):
div class=“product-item-details”>
a href=“https://testurl.html” class=“product-item-link”>
h3 class=“product-item-name”>MYPRODUCTNAME
I tried a lot, but never succeeded in finding the product on the page matching product name = MYPRODUCTNAME, and then to click on the name so that I get redirected to the product detail page.
How to do that concrete in Katalon? Because the search string can vary - means - I use a variable for it. And I have no idea how to add a variable into an object repository element?
Could you provide me a link to a snippet - that would enormous help me.
Hii, I also happen want to try this method but the text element was not found
the error in log viewer
Unable to find the element located by ‘By.xpath: //h3[contains(text(), ‘1846’)]’. Please recheck the objects properties to make sure the desired element is located.
It search xpath address that contains the value, is that right?
also is there any method to click an object based on text that displayed in html with random generated xpath? (Click an id number, the number in html as a pointer)
Thank you very much for your topic! It may take a little while before Katalon team member or others forum members respond to you.
In the meantime, you can double-check your post to see if you can add any extra information i.e. error logs, HTML codes, screenshots, etc. Check out this posting guide to help us help you better!