18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Problem with dynamic web page

josue.boixjosue.boix Members
edited November -1 in Sahi - Open Source
Hello,

I am trying to automate a process in a dynamic web page. When the page is loaded, it shows a list of elements, dynamically, and each one of theses elements have a lot of different objects like buttons, radio buttons, link, cells, etc.

The fact is that all the different objects are repeated, so I have got a huge list like the following:

id_element
edit
link[1]
link[2]
button[1]
radio[1]
...
id_element
edit[1]
link[3]
link[4]
button[2]
radio[2]
...
id_element
edit[2]
link[5]
link[6]
button[3]
radio[3]
...

The problem here is that the elements are listed randomly each time they are loaded, so it is impossible to determine where is the location of the radio and the button I need to use.

I am able to find the edit button located right after the id element, with a instruction like the following:

browser.link("/Edit/").near(browser.link(this.oppositionNumber)).click();


So I could use the name of the accessor to guess the index in order to locate the button and the radio. Is there a property to know exactly the name of the accessor that we have just clicked?

Thanks in advance for your help.

Best regards,

Josué

Comments

  • narayannarayan Administrators
    If you have a name property to the link, use
    String name = browser.link("/Edit/").near(browser.link(this.oppositionNumber)).fetch("name");
    If you are looking for the id, use
    String id = browser.link("/Edit/").near(browser.link(this.oppositionNumber)).fetch("id");
    etc.

    Regards,
    Narayan
Sign In or Register to comment.