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.

Not able to run a test suite with random auto-generated ids

jeevarathinamsjeevarathinams Members
edited November -1 in Sahi - Open Source
Hi,

I'm working in Sahi for the automation testing of web application. I'm not able to run a test suite with random auto-generated ids in the application.

For eg - I'm working on Mantis application(Bug tracking tool). Here different user has different access rights. User1 has Reporter rights(report an issue to the developer), User2 has Developer rights(acknowledges the issue to the reporter) & User3 has Updater rights(Updates an issue).

I'm creating 3 different script file for the 3 different users as Mantis1.sah(for Reporter), Mantis2.sah(for Developer) & Mantis3.sah(for Updater) by recording it with steps.

Mantis1.sah file contains the below script(to report an issue by a reporter),
_setValue(_textbox("username"), "xxxxxxxxxxx");
_setValue(_password("password"), "xxxxxxxxx");
_click(_submit("Login"));
_click(_link("Report Issue"));
_click(_submit("Select Project"));
_setValue(_textbox("summary"), "Delete Audio");
_setValue(_textarea("description"), "Not able to delete the audio file");
_setValue(_textarea("additional_info"), "This issue exist only in Fire Fox");
_click(_submit("Submit Report"));
_click(_link("Logout"));

After reporting the issue, it will generate a random auto-generated id for the reported issue.For eg - 0030975
Mantis2.sah file contains the below script(to acknowledge an issue by a developer),
_setValue(_textbox("username"), "xxxxxxxxx");
_setValue(_password("password"), "xxxxxxxxx");
_click(_submit("Login"));
_click(_link("0030975"));
_click(_submit("Update Issue"));
_setSelected(_select("status"), "acknowledged");
_click(_submit("Update Information"));
_click(_link("Logout"));

Here it displays the Issue.Id(0030975) in the form of link, so we should click on this Issue.ID(0030975) link to acknowledge the issue.
Mantis3.sah file contains the below script(to update an issue by an updater),
_setValue(_textbox("username"), "xxxxxxxxxxx");
_setValue(_password("password"), "xxxxxxxxx");
_click(_submit("Login"));
_click(_link("0030975"));
_click(_submit("Update Issue"));
_setSelected(_select("handler_id"), "xxxxxxxxxx");
_setSelected(_select("status"), "closed");
_click(_submit("Update Information"));
_click(_link("Logout"));

Here also it displays the Issue.Id(0030975) in the form of link, so we should click on this Issue.ID(0030975) link to update the issue.
Now i'm creating a test suite file with the extension Mantis.suite. When we run this test suite using cmd prompt, first it runs the Mantis1.sah file to report an issue and creates a new Issue.Id as "0030998" in the Mantis application but when it runs the Mantis2.sah file & Mantis3.sah file , the script throws an error in the log & failure message in the cmd prompt, because in the 2nd script(i.e. Mantis2.sah file) & 3rd script(i.e. Mantis3.sah file) contains the Issue.Id as "0030975".

I'm facing some issues in finding the concept this issue in SAHI. Can anyone please provide me a solution to solve this issue?

Thanks in Advance

Regards,
Jeeva

Comments

  • Hi jeevarathinams,

    You will have to use regular expression to run a test suite with random auto-generated ids.

    Use: _click(_link("/0030/"));

    Let me know if this solves your issue.

    Regards
    Sumitra
  • Hi Sumitra,

    Thanks for your informative reply. I will work into it & let me come back to you if i face any issues.

    Regards,
    Jeeva
Sign In or Register to comment.