Find position of an element on the website via textsearch and identify locator

Hi,
I have a website with around 100 classes/elements listed one after the other. This is how the classes are listed on the website:


I need to change 5 particular classes coming from an input file and click the change button. How can I best find the right class and click the corresponding change button?

Currently I have a solution that does for each of the 5 classes loop over the 100 classes in order to find the corresponding class title via command “verifyText” (looping the locator from 1 to 100). Once it is found I click the button of the same line. This is how the locator looks like: css=#course-list-container > “div:nth-child(’ + ${1-100} + ') > div.panel-heading.admin-course-heading > div.admin-course-heading__info > div:nth-child(2)”.

This procedure takes alot of time to do all the loopings (max. 5x100 = 500 loops).

Is there a solution where I can search for the title on the website and then identify the locator? This would safe alot of time.

The solution is to use xpath axes which are xpaths with an anchor. Unfortunately ui vision does not record them but you can find them by studying the page or external tools. The xpath axes are hard to use but allow you to find items near each other.

With the XPath Axes I can identify objects relative to the current node. So what would be the current node in this case? Before I do that I need to search for the class title in order to have a reference node. How do I do that?

As i wrote to you before xpath axex are hard to use.

I remember in the past I created an xpath for a similar case. in your case xpath axes must have as anchor the text which is different and then click icon.

Another solution that you can use but is very slow and difficult is XclickRelative but you will have to save the images of each record to edit

I am not sure whether we are talking about the same use case. My problem is not to find the button next to the text to click on. My problem is to find out of the 100 lines the line with the corresponding class title. I have the exact text of the title. But I am missing a search function for the text of an object.

With xpath axes you can find an element near another you have to find the button near the text of your choice.
The xpath axes are difficult to use, ui vision supports them but does not register them so you will have to manually find it yourself.
The alternative is to use XclickRelative but you will have to save the image of each text to find and it is slow and also difficult work.
I can’t think of any other simple solutions to your problem