"waitForPopUp" Command

Remember one thing that selenium IDE software automation testing tool can handle only one window at a time. When you are taking some action like clicking on link or button and open new popup window then how to handle it in selenium IDE software automation tool? "selectWindow" command will help you to select window but before that you need to verify that your expected window is open or not. "waitForPopUp" command will help you to wait until your expected window is not open. 

You can give JavaScript window "name" of the window in to target of "waitForPopUp" command. If you leave target blank or "null" then "waitForPopUp" will wait for the first non-top window to appear. Put

"verifyTable" Command


When you are working with table content with selenium IDE then you must have knowledge of how to use "verifyTable" Command. "verifyTable" Command verifies the text of targeted table's row and column. With "verifyTable" Command, you must have to specify your row and column matrix with target element. Example table.0.1 describes row no 0 and column no 1.


In bellow given example, "verifyTable" Command will verifies that table's row no 0 and column no 1 contains text "Last Name" or not. It will be pass if actual value match with given value in value field else it will return error message in log. In this case it will be pass. You can check it your self by replacing text "Last Name"

"assertElementPresent" Command

Selenium assert element present command is useful to confirm element availability on page after user taking some action or navigate to some other page. Selenium assert element present will force selenium to stop execution if targeted element not found on the page. It will continue execution if return result of condition "assertElementPresent" = false and will stop execution if return result of condition "assertElementPresent" = true.

In bellow given example, command "assertElementPresent" will verify that element "id=gbqfba" is there on the page or not. if element "id=gbqfba" (google search button) found on the page then it will execute next

"verifyLocation" Command
Soometimes you need to check the URL of current selected window to perform some actions. In such cases, selenium has two commands to verify the absolute URL of the current selected page. "verifyLocation" and "assertLocation".

"verifyLocation" command will just verify your trageted URL with absolute URL of the current page and returns error message if match not found and will go for executing next command. In bellow given example, first "verifyLocation" will becomes pass but 2nd "verifyLocation" will be fail because trageted URL will not

"waitForAllFields" Command

Sometimes when page speed or internet speed is too much slow and page taking too much time to load its element in that case if your targeted element not appears on page withing timeout period then your script will fail. In such cases you need to use commands like "waitForAllFields" and "waitForAllButtons" in selenium IDE.

There are 3 types of assertions available in selenium IDE
1. assert
2. verify
3. waitfor

"waitForAllFields" command will pause the selenium till the given time in value column if the fields which are specified in target column are not appear on the page. Here field means input fields. In bellow given example,

"storeElementHeight" command

"storeElementHeight" command useful to measure the height of elements like button, textbox, images etc. You need to measure element's height and width in pixel to pixel testing. Using selenium, you can measure it very easily. "storeElementHeight" command returns height of targeted element and store it into variable specified in value field.

Here is the one simple example of measuring height of google search box(Text field). In bellow given example, "storeElementHeight" command will store height of search box into variable "i". "echo" helps you to see variable's value (height of an element).

"setSpeed" and "setTimeout" are very basic useful commands in selenium IDE software testing tool. User can control selenium speed and timeout period when running the software test script.

"setSpeed" Command
"setSpeed" Command setup the delay between two command execution or we can say it is useful to managing the execution speed of  selenium IDE software. By default there is not any such delay but if your software web application is slow then you have to use "setSpeed" Command in your script.

Here is the simple example where i have set up 3000 millisecond speed. First run this software test script with "setSpeed" Command and then run it by removing "setSpeed" Command to see its difference.

There are many types of HTML DOM Events available on web page. In selenium IDE, "fireEvent" command is the solution to handle such kind of events. Here i am trying to show you the use of "fireEvent" command with focus or blur event. You can handle any other event in this way.

"fireEvent" command with "focus" event

Let we see it with example. In bellow given example, when element "css=input[type="text"]" gets focus, its color becomes yellow. Here i have used "fireEvent" command to get focus on that element. Run the script and observe yourself. You can use this command combination when the event occurs when an element gets focus. I have placed 5 second pause period to see event's effect.

"storeElementPositionLeft" Command

In selenium, Many times you need  horizontal and verticle position of element on page. When you need any element's horizontal position on the page, you can use "storeElementPositionLeft" Command. It will return and store element's horizontal position in to specified veriable in value column.

In Bellow given example, storeElementPositionLeft command will store google search box's horizontal position in to variable "left".

"chooseCancelOnNextConfirmation" command

"chooseCancelOnNextConfirmation" command used with confirmation popup box. When you are performing some major action like deleting records at that place you can see this kind of confirmation message box to proceed or to cancel the process. "chooseCancelOnNextConfirmation" command will click on cancel button on this kind of action.

Here is the example of "chooseCancelOnNextConfirmation" command.In bellow given example, selenium will click on cancel button of confirmation box. Here it is predefined action to perform on next command.

New Test
CommandTargetValue
openhttp://www.w3schools.com/ js/tryit.asp?filename =tryjs_confirm
selectFrameview
chooseCancelOnNext Confirmation

click css=button
assertConfirmation Press a button!

"chooseOkOnNextConfirmation" command

There are too many commands starting with "verify" and "assert" text. Both these commands are same excluding one difference and that difference is after execution of "verify" command if condition is match or not match selenium will execute next commands but in case of execution of "assert" command if condition

"answerOnNextPrompt" command

Sometime if you seen , there is display text box with popup message to write some thing in message box. In such popup "answerOnNextPrompt" command is useful to providing answer in popup message. "answerOnNextPrompt" command will type the message whatever you want to type in popup.

Here is one perfect example of "answerOnNextPrompt" command to learn it better. In bellow given example, when user clicking on "Try it" button, It is opening one popup message box with text box. answerOnNextPrompt command will type text "Test" into popup message text box. Please note one thing here - answerOnNextPrompt command is written before click button command which opens the popup. In this way we can predefine the answer what we want to enter into popup text box.

New Test
CommandTargetValue
openhttp://www.w3schools.com/js/tryit.asp?filename =tryjs_prompt
selectFrameview
answerOnNextPromptTest
click css=button
assertPrompt Please enter your name

"assertPrompt" Command

"altKeyDown" command

"altKeyDown" command works just like you are pressing alt key of your keyboard. It will keep pressed alt key until "altKeyUp" not executed. You can use this command when you need to perform any action by pressing alt key.

Let me show you use of "altKeyDown" command with example. In bellow given example, altKeyDown command will press and hold alt key down then click command will click on targeted element.

New Test
CommandTargetValue
openhttps://www.google.co.in/
altKeyDown

clickcss=#gb_2 > span.gbts
altKeyUp


"altKeyUp" command

 "addSelectionAndWait" command in selenium IDE

When you are adding selection into multi select list box and page reloading due to the adding selection, you need to use addSelectionAndWait command to handle page loading event. You can use addSelection if page not reloading after adding selection.

I have not any perfect example of page reloading when adding selection in list box. Let me try to show you how to use addSelectionAndWait command.


New Test
CommandTargetValue
openhttp://only-testing-blog.blogspot.com/2013/09/testing.html
addSelectionname=FromLBlabel=Japan
addSelectionname=FromLBlabel=India
addSelectionAndWait name=FromLBlabel=Mexico

In this example, when selection label=Mexico, page not reloading so that this command will be not helpful

"addSelection" Command

In multiselect list box, when you need to select multiple values from list box, "addSelection" command will be helpful in selenium IDE. "Select" command will select only single value from list box but "addSelection" command will add new value selection in list box means previously selected values will remain selected as it is and will add new selection.

Run bellow given example yourself to understand it better. In this example, first i am adding value "Japan" from list box using "addSelection" command and next 3 commands will select 3 new values using "addSelection" command.

New Test
CommandTargetValue
openhttp://only-testing-blog.blogspot.com/2013/09/testing.html
addSelectionname=FromLBlabel=Japan
addSelectionname=FromLBlabel=Mexico
addSelectionname=FromLBlabel=India
addSelectionname=FromLBlabel=Spain

VIEW PRACTICAL EXAMPLE IN SELENIUM WEBDRIVER OF addSelection COMMAND

"removeSelection" Command

"removeSelection" command works in opposite of "addSelection" command. It will remove selection of