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.
regrding Arrays
Hi,
Here is my scenario.
_setSelected(_select("ctl00\$cphClientBody\$ddlISO"), $Currency); //$currency is given by Excel.
am having number of groups like this,
Var $1 = Rupees,dollars
var $2 = dinar,pound
And so on...
After this am using switch case
switch case(var);
case 1: some actions
case 2: Some actions
And so on.....
Logic is First i have to search my string in All the arrays. If an array gets matched then corresponding case has to be executed...
Pls Help...
Here is my scenario.
_setSelected(_select("ctl00\$cphClientBody\$ddlISO"), $Currency); //$currency is given by Excel.
am having number of groups like this,
Var $1 = Rupees,dollars
var $2 = dinar,pound
And so on...
After this am using switch case
switch case(var);
case 1: some actions
case 2: Some actions
And so on.....
Logic is First i have to search my string in All the arrays. If an array gets matched then corresponding case has to be executed...
Pls Help...
This discussion has been closed.
Comments
I don't really get you.. what are the arrays you are talking about? please provide more information on your problem. I hope this can help you http://www.tutorialspoint.com/javascript/array_indexof.htm or
Encapsulate all the available array into a new array. so the new array becomes a two dimensional array and iterate over it to find, if the string exists. If the string exists, get the index of the array and using the index, you can execute certain switch case.
For eg:
Hope this might help you.
Regards,
Theeran.
Its working fine. But in my case For $string am passing the values from Excel. While passing, it wont return the i value. And not going to switch case.
I got the error like this,
_setSelected(_select("ctl00\\$cphClientBody\\$ddlISO"), "i"); Error: The parameter passed to _setSelected was not found on the browser
Please look into that pblm.
Thnx.
Finally i got it... I didnt return the i value to the function... Directly took that value..
Thnx.. Its wrkn fine..
My script:
for(var $i=0;$i<$ConArray.length;$i++){
for(var $j=0;$j<$ConArray[$i].length;$j++){
if($ConArray[$i][$j] == $Currency){
_alert($i);
switch ($i)
{
case 0: