Dynamic selectors do not work sometimes

Hello, I have a web automation problem.
I have a list of tickets like this. And I have an Excel file containing a list of the numbers of some of these tickets. So I would like to go through my datatable, and for each ticket number, do some operations on the ticket

So I use a dynamic selector to click on the right ticket

tmpTicketNum is the ticket number, and it is always contained in the selector.

What frustrates me is that yesterday it worked very well, and today it doesn’t, even though I haven’t changed that part.
I have different behaviors when I run several times, sometimes it does not find the selector, or sometimes it clicks on another ticket, which is not the right one.

Am I doing wrong with dynamic selectors?
I also have another small question, but less important than the first. To go to the next page when there is no “next page” button, is there any other way than looking if the page number exists with the elementExists activity, and if it exists, click on it?

Thanks

as the valoue comes from Excel ensure to have trimmed the Excel value before using it within the dynamic selector part

Several techniques are possible and depends on the detailed webnpage structure

  • click most right button / recognize the end e.g. by not changing number
  • element exists (check for next number link) → start try with this
  • find children on paging buttons

Yes, I always trim my variables, like this
tmpTicketNum = CurrentRow.Item(0).ToString.Trim

After some tests, it seems that the sendwindowmessages and simulateClick methods are the problem. When I leave them unchecked and use the normal method, it seems to work.

Thanks, I’ll continue with the second method I think, it seems to me the safest
Or I do a get Text on the page bar, I take the biggest number = the number of pages
Then a loop that goes through the pages with a dynamic selector to click on the page number of the current iteration.
But maybe it seems too complicated for that

running with page=4
check with element exists -do we have link with 5?
Yes - click
No - we are on end

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.