There are many advanced selenium IDE tutorial posts available about different commands, methods and selenium IDE plugins and i think that all of them will help you to make your software testing process easy using selenium IDE. Now let me tell you one more interesting and most useful command to include in your
main commands directory list and i hope it will helps you.
"getEval" Command
In Selenium IDE, "getEval" command is useful to run javascript snippet when command get executed. Run bellow script in your selenium IDE and see what happens. "gotoIf" and "gotoLabel" commands will be supported in selenium IDE only if you have attached user extension with selenium IDE. Click here to read more about "gotoIf" and "gotoLabel" commands.
New Test | ||
Command | Target | Value |
store | String Message | Str1 |
echo | ${Str1} | |
store | String Message | Str2 |
echo | ${Str2} | |
gotoIf | storedVars['Str1']==storedVars['Str2'] | Check2ndStr |
getEval | alert("Sorry, Str1 does Not Match with Str2..") | |
gotoLabel | 2ndStrCheck | |
label | Check2ndStr | |
getEval | alert("Both Strings are Same :)") | |
label | 2ndStrCheck | |
store | Message String | Str2 |
echo | ${Str2} | |
gotoIf | storedVars['Str1']==storedVars['Str2'] | correct |
getEval | alert("Sorry, Str1 does Not Match with Str2..") | |
gotoLabel | finish | |
label | correct | |
getEval | alert("OK.. Now Both Strings are Same :)") | |
label | finish |
I hope you are already aware about all other commands except "getEval" command. So let me describe here just "getEval" command. In above script, when "getEval" command executed, it will generate alert message with string written in target column and selenium will stop execution. Once you click on 'OK' button of alert message, once again selenium IDE will start next command execution. This way, You can put alert message in between selenium IDE script to get alert during software testing using selenium IDE. You can use "getEval" command for data driven testing using selenium IDE.
No comments:
Post a Comment