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.
split() method not returning an array?
I'm trying to use the split() method to create an array and then pass that to _datadrive() but it's failing with:
Logging exception:
second argument to Function.prototype.apply must be an array
Here's my script...
What am I doing wrong?
Logging exception:
second argument to Function.prototype.apply must be an array
Here's my script...
$someText = "!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?1234567890-=qwertyuiop[]asdfghjkl\;'zxcvbnm,.";
$data2 = $someText.split("");
_dataDrive(createUnit, $data2);
What am I doing wrong?
Comments
From my example above, split is returning the following string (via _alert):
_alert(["!","@,#","$","%","^","&","*","(",")","_","+","Q","W","E","R","T","Y","U","I","O","P","{","}","|","A","S","D","F","G","H","J","K","L",":","\"","Z","X","C","V","B","N","M","<",">","?","1","2","3","4","5","6","7","8","9","0","-","=","q","w","e","r","t","y","u","i","o","p","[","]","a","s","d","f","g","h","j","k","l",";","'","z","x","c","v","b","n","m",",","."]);
So, how can I get split()
How can I get split() to return an array? Am I missing something?
Thanks,
Brian
Nevermind
B
Okay, I was doing this right, I just got turned around on it. This *should* work but does not...
But it fails with the following:
Logging exception:
second argument to Function.prototype.apply must be an array