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.
64k limit, need a workaround
First this is a great application, thanks!
Here's my script:
_click(_link("Duplicate"));
_setSelected(_select("portlet_17_1wlw-select_key:{actionForm.numAccounts}"), "1");
_click(_submit("Go"));
_setValue(_textbox("portlet_17_1{pageFlow.duplicateList[0].url}"), "somesitedotcom");
_click(_submit("Done"));
I have a spreadsheet of roughly 600 URLs to be processed by this script. Using the CONCATENATE function in Excel I was able to create a .sah file containing the script to execute this for all the URLs, however when I try and run it an error tells me the file is too large (exceeds 64k) or something to that effect. I'm sure there's a way to grab the values from the Excel sheet instead of manually creating the script, but I'm not sure how to do so, and this script works with smaller numbers of URLs (say, 25). How do I go about automating the script to 'communicate' with the Excel sheet instead of manually creating a script that's apparently too large?
Here's my script:
_click(_link("Duplicate"));
_setSelected(_select("portlet_17_1wlw-select_key:{actionForm.numAccounts}"), "1");
_click(_submit("Go"));
_setValue(_textbox("portlet_17_1{pageFlow.duplicateList[0].url}"), "somesitedotcom");
_click(_submit("Done"));
I have a spreadsheet of roughly 600 URLs to be processed by this script. Using the CONCATENATE function in Excel I was able to create a .sah file containing the script to execute this for all the URLs, however when I try and run it an error tells me the file is too large (exceeds 64k) or something to that effect. I'm sure there's a way to grab the values from the Excel sheet instead of manually creating the script, but I'm not sure how to do so, and this script works with smaller numbers of URLs (say, 25). How do I go about automating the script to 'communicate' with the Excel sheet instead of manually creating a script that's apparently too large?
This discussion has been closed.
Comments
Have a look at http://sahi.co.in/w/data-driven-testing
Let us know if you are stuck somewhere.
Regards,
Narayan
Thanks for the information. I read through the corresponding pages, however I'm failing to understand how the examples directly correspond to my situation. Getting sahi to 'communicate' with the Excel file is straightforward using var db = _getDB, however I'm not clear as to what to do next. How do I get the URLs listed in the file to propagate into my function automatically?
For example, if I have a single column Excel file with the word URL in cell A1, somesite2.com in A2, somesite3.com in A3, and somesite4.com in A4, how do I tell sahi to incorporate those values into the script mentioned in my first post? Please keep in mind I did create the script manually already using the CONCATENATE function and sahi won't run because the .sah file is too large.
I'm sure this is easier than I'm making it, and any additional help or examples is appreciated.
Sahi will consider the first line of Excel as a header. So give it a name like URL
So your Excel now looks like:
---
URL
http://site1.example.com
http://site2.example.com
---
Move your steps into a function and allow it to take a parameter for the URL. Then invoke your function in a loop.
Hope that helps.
Regards,
Narayan
The first suggestion worked, thanks!
I am now trying a script with more steps, however I get an error stating "JSERROR missing ) after argument list" each attempt. The concept is the same, I'm using an Excel sheet with only one column (although with 17000 rows instead of 3 this time). I kept the cell A1 the same as your other example (URL) and the path to the Excel sheet is correct. Any suggestions?
and
Hope that helps.
1
2
3
When the numbers are copied into my web form, they are done so as follows:
1.0
2.0
3.0
The .0 screws up the process. I have tried adding a ' as in '1 but then sahi reads it as null. Any suggestions?
eg.
_setValue(_textbox("count"), parseInt($i));