Parameterization in selenium IDE using data.js file is described with example in my previous post. You must have Advanced Selenium IDE knowladge for Parameterization in selenium IDE. Now Parameterization using "push" command is another way of data driven testing in selenium IDE for your software web application regression of functional testing. Please note, "push" command is not supported by default in selenium IDE so you need to attach (Click here for how to
attach user extension with selenium IDE) user extension with selenium IDE to extend functionality of selenium IDE. Please don't forget to restart selenium IDE after attaching user extension with selenium IDE.
Now create bellow given test case in your selenium IDE.
New Test | ||
Command | Target | Value |
setSpeed | 500 | |
getEval | delete storedVars['MyArray'] | |
open | http://www.google.com | |
push | Acura | MyArray |
push | Audi | MyArray |
push | Bentley | MyArray |
push | BMW | MyArray |
push | Chevrolet | MyArray |
storeEval | storedVars['MyArray'].length | length |
store | 0 | MyVar |
while | storedVars['MyVar'] < storedVars['length'] | |
storeEval | storedVars.MyArray[${MyVar] | carname |
echo | ${carname} | |
type | id=gbqfq | ${carname} |
click | id=gbqfba | |
pause | 2000 | |
store | javascript{storedVars.MyVar++;} | |
endWhile |
Run above test in selenium IDE and look command execution carefully. Only difference between both the parameterization method is - in 1st example (Described in previous post), "storeEval" command was reading value from array 'carnamearray' located in data.js file. While in above example, First of all "push" command will fill array (MyArray) and then "storeEval" command will read value from array one by one.
- Here, initial "getEval" command will delete all values from variable array 'Pusharray' if there is any.
- "push" command will fill array 'MyArray' with car names (Acura,Audi,Bentley,BMW,Chevrolet)
- All the remaining commands will works same as described in 1st method of parameterization for software testing using selenium IDE.
Hello
ReplyDeleteThank u for ur informative post.
Can i get the link for the user extension which is to be used for Push command.
Thanks & Regards,
danikadain
Thank you so much... i have downloaded and used ur extension file and now it works fine.
ReplyDeleteThanks again for the clear explanation and timely support.
can u pls advice how to link a file in this blog.
Deletei would like to attach two files (selenium js files) in which i had some doubt to be clarified by u.
Deletethank you for the clear explanation but I am not able to proceed after this line -
ReplyDeletestoredVars['MyVars'] < storedVars['length']
It seems to read this line but nothing happens after that...
Please help!
Hi,
ReplyDeletethank you for the post.
My program reads the line storedVars['MyVars'] < storedVars['length'] but nothing happens after that I think it goes into infinite loop.
Please help to resolve this!