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.

Regarding "customize" button

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

I am Test Engineer and new user to the Sahi. I have a query on Save button.

When I am recording the GUI application,

On the first page after populating the data on the first page the recorded save button in the script shows _click(_button("Save"));

On saving, a new panel pops and needed to populate the data and again need to click on the Save button, then the scripts shows, "_click(_button("Save[1]"));" _click(_button("Save[3]")); and so on.

Here need to customize the Save button, as in QTP i did highlighted the save button in the script. on running the script in the UI, the save button is highlighted but the save button is not clicked. To click the save button I need to execute the _click(_button("Save"));.

So, how can I customize the save button? Can any one help me out.

Comments

  • ashokashok Members
    Anup,

    How many Save buttons are there in popup?

    Thnaks,
    Ashokan.
  • AnupAnup Members
    Hi Ashokan,

    In my application, I have put a for loop. So for one iteration there is around 25 Save button, in that nearly 12 windows pops up and need to click the Save button.

    example:
    ......
    ......
    _click(_button("Save[1]"));
    _click(_cell("OK"));
    .......
    .......

    .......
    _click(_button("Save[25]"));
    _click(_cell("OK"));

    For this i declared a variable and incremented as below

    var $n = 1;
    var $S = "Save[$n]";

    But it fails and gives an error message,

    _click(_button("Save[$n]")); Error: The parameter passed to _click was not found on the browser.

    Can you please help me out

    Thanks,
    Anup
  • Hi

    you must not put a variable in double quotes. a change to var $S = "Save["+$n+"]" might make it work.

    Regards
    Wormi
  • AnupAnup Members
    Ya I did so and it works well.
    The issue is, when ever I want to click the save button but I need to increment the value.
    So can I customize the "Save button" in which ever page I see the Save Button so I can avoid the increment the Save every time.

    Thanks for the double quote issue.
  • ashokashok Members
    Hi Anup,

    Please try with below code. it might work.

    _click(_button("/Save.*/"));


    Thanks,
    Ashokan.
  • AnupAnup Members
    Sorry Ashokan, its not working. It failed in Save[1] itself. Will try with other RE aswell.

    Scenario is,
    1) when I populate the data in first page and click on the save button the sahi save it as _click(_button("Save"));
    2) After saving will click on the Add Button, an new panel will pop up.
    3) After populating data an do save, sahi save it as "_click(_button("Save[1]"));" and so on...

    Here instead of increment the variable, can we have any other customize thing
Sign In or Register to comment.