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.

Testing of Dynamic data

AnkitaAnkita Members
edited November -1 in Sahi - Open Source
I have a form wherein I ask input from user(for ex name)
This page is then redirected to the new page which consists of the newly added name as well as the ones previously added.

In this way every time my 2nd page will contain dynamic data

How can I do this.

Please do let me know

Comments

  • what you want to do on page two. i mean please elaborate on the requirements.

    Regards,
    Pankaj
  • Elaborating my question.
    Case is as follows.


    1st page I have a form wherein I ask input from user(for ex pollname)
    This page is then redirected to the new page
    Now on the second page I have the list of all the poll names (old one as well the new one) .One on each line.

    First I need to check whether the poll created on first page is visible on second page.
    Followed by that I also need to check that associated with poll name do I get the button. which helps me to add another functionality of poll.(ex posting the suggestion on the poll created).

    Now if the case is static I can do this.
    But as names are dynamically increasing how can I make the generalized test case.

    That means every time the last record of my poll table should be checked and its associated name should be displayed automatically
  • narayannarayan Administrators
    Ankita,

    Store your poll name in a variable and then use it to identify later.

    Eg.
    var $pollName = "Poll_" + _random(1000);
    _setValue(_texbox("poll"), $pollName);
    // Create it
    // Navigate to next pae
    // Check if the poll exists. Suppose it is present in a table cell
    _assertExists(_cell($pollName));
    // Check the button near it.
    // Assuming that the button is "Edit" and you want to ensure that it is in the same row as $pollName,
    // You will first get the row where $pollName is and check that the edit button is present in that row.
    _assertExists(_button("Edit", _in(_parentRow(_cell($pollName)))));
    
Sign In or Register to comment.