18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Adding values to an array
Hi All,
My web-page has a "Restore Defaults" option which when clicked will restore all the various DOM elements to its default settings.
Now I wanted to check that so I modified all the values and saved the config. When i return to that page I see the modified values(as obvious) when I click "Restore Defaults" It gets restored to factory settings.
Now here is my question. How do i check for this particular feature.?
My initial and obvious solution was to obtain the default values and store then on to an array and then change the values -> save-> restore defaults-> check.
But I was not able to find out how to push values to an array in SAHI. Any ideas ?
Also in such a scenario. what is the best approach.?
Thanks
My web-page has a "Restore Defaults" option which when clicked will restore all the various DOM elements to its default settings.
Now I wanted to check that so I modified all the values and saved the config. When i return to that page I see the modified values(as obvious) when I click "Restore Defaults" It gets restored to factory settings.
Now here is my question. How do i check for this particular feature.?
My initial and obvious solution was to obtain the default values and store then on to an array and then change the values -> save-> restore defaults-> check.
But I was not able to find out how to push values to an array in SAHI. Any ideas ?
Also in such a scenario. what is the best approach.?
Thanks
Comments
the push() function is a common javascript function and can be used in Sahi without problems: http://www.w3schools.com/jsref/jsref_push.asp
If you have a specific default state, I would store these state beforehand. When generating a default state array with Sahi, you can't be sure, that everything looks like you expect. Example: you have a picture xy.jpg somewhere in the DOM tree. Now there's a bug and the wrong picture (ab.jpg) is displayed.. but Sahi assumes that ab.jpg is the default if you don't explicit store xy,jpg... I hope you can follow my drift.
Regards
Wormi