Tutorial For Selenium IDE "getEval" Command To Get Alert During Script Execution

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
storeString MessageStr1
storeString MessageStr2
getEvalalert("Sorry, Str1 does Not Match with Str2..")
getEvalalert("Both Strings are Same :)")
storeMessage StringStr2
getEvalalert("Sorry, Str1 does Not Match with Str2..")
getEvalalert("OK.. Now Both Strings are Same :)")

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