<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=Selenese_Primer</id>
	<title>Selenese Primer - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=Selenese_Primer"/>
	<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Selenese_Primer&amp;action=history"/>
	<updated>2026-04-24T08:29:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://training-course-material.com/index.php?title=Selenese_Primer&amp;diff=61420&amp;oldid=prev</id>
		<title>Ksolis at 08:48, 2 October 2017</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Selenese_Primer&amp;diff=61420&amp;oldid=prev"/>
		<updated>2017-10-02T08:48:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[File:Nobleprog.svg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;np_frontpage_header&amp;quot;&amp;gt;&amp;lt;p&amp;gt;Test Automation with Selenium (Python Track)&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;np_frontpage_footer&amp;quot;&amp;gt; &amp;lt;p&amp;gt;Copyright © 2015 NobleProg™. All Rights Reserved.  www.nobleprog.us&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PB}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--__NOTOC__--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PB}}&lt;br /&gt;
&lt;br /&gt;
=Selenese - Selenium IDE commands=&lt;br /&gt;
*The commands that run the test&lt;br /&gt;
*They are called Selenese, Selense can:&lt;br /&gt;
::Test HTML page elements based on their tags&lt;br /&gt;
::Test for specific content&lt;br /&gt;
::Fill in forms and submit them&lt;br /&gt;
::Test links&lt;br /&gt;
::Test for form elements&lt;br /&gt;
::Test Ajax functionality&lt;br /&gt;
::Test popup windows&lt;br /&gt;
::Other page features&lt;br /&gt;
*Selenese commands have a simplistic form&lt;br /&gt;
::command, parameter1, parameter2&lt;br /&gt;
:::command parameters are dependent upon the command&lt;br /&gt;
:::generally the parameters are: &lt;br /&gt;
::::a locator giving an element of the page that the command will execute against&lt;br /&gt;
::::either a pattern for an accessor to compare or a variable/input for text/options&lt;br /&gt;
&lt;br /&gt;
=Three Types of Commands=&lt;br /&gt;
==Actions==&lt;br /&gt;
*Actions are commands that manipulate the state of the browser&lt;br /&gt;
::Click a Link&lt;br /&gt;
::Enter text in a textbox&lt;br /&gt;
::Click radio buttons&lt;br /&gt;
::Click a submit button&lt;br /&gt;
::Initiate Ajax actions&lt;br /&gt;
&lt;br /&gt;
==Accessors==&lt;br /&gt;
*Accessors examine the state of the application and store results in variables&lt;br /&gt;
::Store Title&lt;br /&gt;
&lt;br /&gt;
==Assertions==&lt;br /&gt;
*Assertions verify that the state conforms to what is expected&lt;br /&gt;
::Does the page contain x?&lt;br /&gt;
::Is this checkbox checked?&lt;br /&gt;
::Does the page have title x?&lt;br /&gt;
*There are three flavors of assertions&lt;br /&gt;
::Assert - if an assert fails the test is aborted&lt;br /&gt;
::Verify - if a verify fails the failure is logged and the test continues&lt;br /&gt;
::Waitfor - waits for some condition to be true then continue the test&lt;br /&gt;
=Action Commands=&lt;br /&gt;
&lt;br /&gt;
Some of the most common commands are the following:&lt;br /&gt;
::See References&lt;br /&gt;
:::[http://www.tutorialspoint.com/selenium/selenium_commands_actions.htm TutorialPoint on Common Action Events]&lt;br /&gt;
:::[http://docs.seleniumhq.org/docs/02_selenium_ide.jsp#commonly-used-selenium-commands Selenium site on Common Events]&lt;br /&gt;
:::[http://release.seleniumhq.org/selenium-core/1.0.1/reference.html#actions Selenium Reference on Action Commands]&lt;br /&gt;
:::[http://software-testing-tutorials-automation.blogspot.com/2013/07/list-of-selenium-commands-with-examples.html Selenese Commands with Examples]&lt;br /&gt;
&lt;br /&gt;
*addSelection - adds an additional option (multiple options can be added) from a drop down select box&lt;br /&gt;
*click(locator) - clicks on a link button, checkbox or radio button&lt;br /&gt;
*clickAt(locator, coordString) - clicks on an element using a locator and coordinates&lt;br /&gt;
*clickAndWait(locator) - clicks on a link button, checkbox or radio button and waits until the action is completed, i.e. the page loads&lt;br /&gt;
*close() - closes the browser or popup window, simulates clicking on the browser or popup close button&lt;br /&gt;
*contextMenuAt(locator, coordString) - Simulates opening of the context menu of an element&lt;br /&gt;
*doubleClick(locator) - double clicks on a element in the web page&lt;br /&gt;
*dragAndDrop(locator, movementString) - (does not work some of the time) drags an element and then drops it on the specified element&lt;br /&gt;
*dragAndDropToObject(dragObject, dropobject) - (does not work some of the time) drags an element and drops it on another element&lt;br /&gt;
*echo(message) - prints a message on the console, used to debug&lt;br /&gt;
*fireEvent(locator, eventName) - explicitly simulate an event to trigger the corresponding &amp;quot;onevent&amp;quot; handler&lt;br /&gt;
*focus(locator) - move the focus to the specified element&lt;br /&gt;
*highlight(locator) - changes the background color of the specified element to yellow briefly, useful for debugging&lt;br /&gt;
*mouseDown(locator) - simulates a user pressing the left button on the specified element&lt;br /&gt;
*mouseDownAt(locator, coordString) - simulates a mouse down at the specified location on the specified element&lt;br /&gt;
*mouseUp(locator) - simulates a mouse up on the specified element&lt;br /&gt;
*mouseUpAt(locator, coordString) - simulates a mouse up on the specified element at the specified coordinates&lt;br /&gt;
*open(URL) - opens a URL in the browser, accepts both absolute and relative paths&lt;br /&gt;
*openWindow(URL, windowID) - opens a popup window, user needs to select it using a selectWindow command&lt;br /&gt;
*pause(waitTime) - pauses for the wait time in milliseconds&lt;br /&gt;
*refresh() - refreshes the browser page, simulates the user clicking the refresh button&lt;br /&gt;
*select(selectLocator, optionLocator) - select an option from a drop-down select list&lt;br /&gt;
*selectWindow(WindowLocator) - selects a window, windowLocator can be window title for example&lt;br /&gt;
*sendKeys(Locator, keysToSend) - will send a set of keystrokes to the locator&lt;br /&gt;
*store(expression, variableName) - store an expression in a variable&lt;br /&gt;
*type(locator, value) - types the value into an input field, simulates user typing action&lt;br /&gt;
*typeKeys(locator, value) - simulates keystroke events as though you typed key by key&lt;br /&gt;
*waitForCondition(script, timeout) - executes the specified javascript snippet repeatedly until it evaluates to true&lt;br /&gt;
*waitForElementPresent(locator) - pauses execution until an expected UI element as defined by its HTML tag is present on the page&lt;br /&gt;
*waitForPageToLoad(timeout) - waitFor a page to load&lt;br /&gt;
*waitForPopUp(windowID, timeout) - wait for a popup to appear and load&lt;br /&gt;
*windowFocus() - gives the focus the the window specified&lt;br /&gt;
*windowMaximize() - resize current window to take up entire screen&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;big&amp;gt;&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Hands on Exercise&amp;lt;/span&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
:::*Go to the google.com website&lt;br /&gt;
:::*Start the Selenium IDE after getting to the web site&lt;br /&gt;
:::*Setup the commands to do the following&lt;br /&gt;
::::Type a search topic, such as North America into the search box&lt;br /&gt;
::::Click on the search button&lt;br /&gt;
::::Click on a link on the search page&lt;br /&gt;
::::Click on some links at the site that you end up going to&lt;br /&gt;
:::*After you setup each command debug by trying the commands entered thus far&lt;br /&gt;
:::*After you have completed a set of commands export the commands to a WebDriver file in your chosen language&lt;br /&gt;
:::*Then correct any errors in the command file due to the translation from Selenese to the programming language chosen&lt;br /&gt;
::::Use a programming IDE such a PyCharm, Eclipse, etc. in correcting errors&lt;br /&gt;
:::*Now run the program from the programming IDE to see if the effect is the same as seen in the Selenium IDE&lt;br /&gt;
&lt;br /&gt;
=Accessor Commands=&lt;br /&gt;
&lt;br /&gt;
Some of the most common accessor commands are the following:&lt;br /&gt;
&lt;br /&gt;
::See References&lt;br /&gt;
:::[http://www.tutorialspoint.com/selenium/selenium_commands_accessors.htm TutorialPoint on Common Accessor Events]&lt;br /&gt;
:::[http://docs.seleniumhq.org/docs/02_selenium_ide.jsp#commonly-used-selenium-commands Selenium site on Common Events]&lt;br /&gt;
:::[http://release.seleniumhq.org/selenium-core/1.0.1/reference.html#accessors Selenium Reference on Accessor Commands]&lt;br /&gt;
:::[http://software-testing-tutorials-automation.blogspot.com/2013/07/list-of-selenium-commands-with-examples.html Selenese Commands with Examples]&lt;br /&gt;
&lt;br /&gt;
*assertErrorOnNext (message) 	Pings Selenium to expect an error on the next command execution with an expected message.&lt;br /&gt;
*storeAllButtons (variableName) 	Returns the IDs of all buttons on the page.&lt;br /&gt;
*storeAllFields (variableName) 	Returns the IDs of all input fields on the page.&lt;br /&gt;
*storeAllLinks (variableName) 	Returns the IDs of all links on the page.&lt;br /&gt;
*storeAllWindowIds (variableName) 	Returns the IDs of all windows that the browser knows about in an array.&lt;br /&gt;
*storeAllWindowTitles (variableName) 	Returns the names of all windows that the browser knows about in an array.&lt;br /&gt;
*storeAllWindowNames (variableName) 	Returns the titles of all windows that the browser knows about in an array.&lt;br /&gt;
*storeAttribute (attributeLocator, variableName) 	Gets the value of an element attribute. The value of the attribute may differ across browsers.&lt;br /&gt;
*storeBodyText (variableName) 	Gets the entire text of the page.&lt;br /&gt;
*storeConfirmation (variableName) 	Retrieves the message of a JavaScript confirmation dialog generated during the previous action.&lt;br /&gt;
*storeElementIndex (locator, variableName) 	Get the relative index of an element to its parent (starting from 0).&lt;br /&gt;
*storeLocation (variableName) 	Gets the absolute URL of the current page.&lt;br /&gt;
*storeSelectedIds (selectLocator,variableName) 	Gets all element IDs for selected options in the specified select or multi-select element.&lt;br /&gt;
*storeSelectedIndex (selectLocator, variableName) 	Gets index (option number, starting at 0) for selected option in the specified select element.&lt;br /&gt;
*storeSelectedLabel (selectLocator, variableName) 	Gets label (visible text) for selected option in the specified select element..&lt;br /&gt;
*storeSelectedValue (selectLocator,variableName) 	Gets value (value attribute) for selected option in the specified select element.&lt;br /&gt;
*storeSelectOptions (selectLocator,variableName) 	Gets all labels in the specified select drop-down.&lt;br /&gt;
*storeTable (tableCellAddress, variableName) 	Gets the text from a cell of a table. The cellAddress syntax: tableLocator.row.column, where row and column start at 0.&lt;br /&gt;
*storeText (locator, variableName) 	Gets the text of an element. This works for any element that contains text.&lt;br /&gt;
*storeTitle (variableName) 	Gets the title of the current page.&lt;br /&gt;
*storeValue (locator,variableName) 	Gets the (whitespace-trimmed) value of an input field.&lt;br /&gt;
*storeChecked (locator, variableName) 	Gets whether a toggle-button (checkbox/radio) is checked.&lt;br /&gt;
*storeElementPresent (locator, variableName) 	Verifies that the specified element is somewhere on the page.&lt;br /&gt;
*storeTextPresent (pattern, variableName) 	Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.&lt;br /&gt;
*storeVisible (locator, variableName) 	Determines if the specified element is visible.&lt;br /&gt;
&lt;br /&gt;
=Assertion Commands=&lt;br /&gt;
&lt;br /&gt;
*There are numerous Assertions.&lt;br /&gt;
**See the IDE commands drop down for a complete listing&lt;br /&gt;
*Assertions are tests for specified items in the web page&lt;br /&gt;
*Assertions succeed or fail&lt;br /&gt;
**Failure causes the Selenium IDE to list the error in the log window&lt;br /&gt;
**Failure causes the Selenium IDE to have a dark red line on its interface&lt;br /&gt;
***over in the middle left hand window&lt;br /&gt;
**It also shows the number of tests that fail (failure) and the number that run (runs)&lt;br /&gt;
*Assertions are the crux of testing with the Selenium IDE&lt;br /&gt;
&lt;br /&gt;
==Using Assertions==&lt;br /&gt;
*Assertions are of two types assert and verify (these are two types of commands)&lt;br /&gt;
**Assert commands cause the IDE to abort when they fail&lt;br /&gt;
**Verify commands cause the IDE to continue when the fail after recording the failure&lt;br /&gt;
*Assertions often need to test stored data&lt;br /&gt;
**Store the body content and then test for certain strings within it&lt;br /&gt;
**Store an attribute of an element and then test that attribute against a string constant&lt;br /&gt;
*Assertions often require the evaluation of existing stored variables&lt;br /&gt;
**With the results of the evaluation saved in another variable&lt;br /&gt;
*It is possible to switch into JavaScript for evaluations&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Notes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*In all of the examples below an action is performed such as &lt;br /&gt;
**Filling a textbox&lt;br /&gt;
**Loading a page&lt;br /&gt;
**Clicking a check box&lt;br /&gt;
*In the examples an assert is then used to test whether the action occurred correctly&lt;br /&gt;
**In testing this would not be the usual pattern&lt;br /&gt;
**It would be assumed that the click, load, or typing worked correctly&lt;br /&gt;
**The tests would instead be on some page other than the form entry page&lt;br /&gt;
***To see if the HTML form and inputs had been processed correctly&lt;br /&gt;
****Once the submit button had been clicked&lt;br /&gt;
*The following are just intended as examples to show how to both&lt;br /&gt;
**Perform an action on an element or load a page&lt;br /&gt;
**Do an assert on particular elements&lt;br /&gt;
&lt;br /&gt;
===Assert on the page Title===&lt;br /&gt;
*assertTitle is the command to check the web page Title&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
     Title is given in the HTML &amp;lt;title&amp;gt; tag.&lt;br /&gt;
     It shows up on the tab for the page in the browser&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;title&amp;gt;This is the page title&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The image below shows the opening of a page and an assertion on its title&lt;br /&gt;
&lt;br /&gt;
[[File:AssertTitle.png | An assertTitle Command in Selenium IDE]]&lt;br /&gt;
&lt;br /&gt;
*The assertTitle command takes one argument in the target field&lt;br /&gt;
**The argument gives the title as a string.&lt;br /&gt;
**It is compared to the actual title of the page from the HTML&lt;br /&gt;
**If the title does not match the argument then the assertion fails&lt;br /&gt;
&lt;br /&gt;
*The Selenium IDE Reference says the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
assertTitle(pattern)&lt;br /&gt;
Generated from getTitle()&lt;br /&gt;
    Returns:&lt;br /&gt;
        the title of the current page&lt;br /&gt;
    Gets the title of the current page.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*The pattern argument is the text that is expected to be in the HTML title element&lt;br /&gt;
*The command succeeds if the HTML title element has the pattern text in it&lt;br /&gt;
*It fails otherwise&lt;br /&gt;
&lt;br /&gt;
===Assert on Text Box Contents===&lt;br /&gt;
*assertValue is the command to check the text in a text box&lt;br /&gt;
**It needs two arguments Target locator and Value to compare against&lt;br /&gt;
***If the content of the box given by the locator does not match the value it fails&lt;br /&gt;
***If the content matches the value it succeeds&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
   The assertValue command is used to get the value typed in a input textbox&lt;br /&gt;
   The input tag in HTML looks like the following&lt;br /&gt;
     &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;FirstName&amp;quot; value=&amp;quot;First Name&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This image shows the assertValue command for testing the contents of a textbox&lt;br /&gt;
[[File:Assert_textbox.png | An assertValue Command in Selenium IDE]]&lt;br /&gt;
&lt;br /&gt;
*The Selenium IDE Reference says the following&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
assertValue(locator, pattern)&lt;br /&gt;
Generated from getValue(locator)&lt;br /&gt;
    Arguments:&lt;br /&gt;
        locator - an element locator&lt;br /&gt;
    Returns:&lt;br /&gt;
        the element value, or &amp;quot;on/off&amp;quot; for checkbox/radio elements&lt;br /&gt;
    Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). &lt;br /&gt;
    For checkbox/radio elements, the value will be &amp;quot;on&amp;quot; or &amp;quot;off&amp;quot; depending on whether the element&lt;br /&gt;
    is checked or not.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*The locator is expected to be of one of the locator types i.e. xpath, id, name, css, etc.&lt;br /&gt;
*The pattern is expected to be the text that should be in the textbox&lt;br /&gt;
*The text in the element given by the locator is compared to the pattern text&lt;br /&gt;
**It fails if they are not equal&lt;br /&gt;
**It succeeds if they are equal&lt;br /&gt;
&lt;br /&gt;
===Assert on Check Box Value===&lt;br /&gt;
&lt;br /&gt;
*assertValue is used to check an HTML checkbox&lt;br /&gt;
**The command needs two arguments Target and Value&lt;br /&gt;
***The Target is a locator&lt;br /&gt;
****Note that locators can be found by clicking the Select button&lt;br /&gt;
*****The Select button is after the Target box in the IDE&lt;br /&gt;
****Then go to Firefox and choose the correct element&lt;br /&gt;
*****The elements are highlighted as the mouse arrow passes over them&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
   An input checkbox is given by an HTML input tag with a type of checkbox&lt;br /&gt;
   The input checkbox tag looks like the following in HTML&lt;br /&gt;
    &amp;lt;input type=&amp;quot;checkbox&amp;quot; name=&amp;quot;vehicle&amp;quot; value=&amp;quot;Bike&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This image shows the assertValue command being used to test a checkbox&lt;br /&gt;
[[File:Assert_checkbox.png | An assertValue Command in Selenium IDE]]&lt;br /&gt;
&lt;br /&gt;
*The Selenium IDE Reference says the following&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
assertValue(locator, pattern)&lt;br /&gt;
Generated from getValue(locator)&lt;br /&gt;
    Arguments:&lt;br /&gt;
        locator - an element locator&lt;br /&gt;
    Returns:&lt;br /&gt;
        the element value, or &amp;quot;on/off&amp;quot; for checkbox/radio elements&lt;br /&gt;
    Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). &lt;br /&gt;
    For checkbox/radio elements, the value will be &amp;quot;on&amp;quot; or &amp;quot;off&amp;quot; depending on whether the element&lt;br /&gt;
    is checked or not.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*The locator is expected to be of one of the locator types i.e. xpath, id, name, css, etc.&lt;br /&gt;
*The pattern is expected to be the values of either on or off (not true or false)&lt;br /&gt;
*The value of the checkbox is compare to on or off&lt;br /&gt;
**On indicates that the checkbox is checked&lt;br /&gt;
**Off indicates that the checkbox is not checked&lt;br /&gt;
***Command fails if they are not equal&lt;br /&gt;
***Command succeeds if they are equal&lt;br /&gt;
*Note that the check is whether the checkbox is checked or not&lt;br /&gt;
**It could be either and if it is not checked and is compared to on&lt;br /&gt;
***Then the assert fails&lt;br /&gt;
&lt;br /&gt;
===Assert on Radio Button Value===&lt;br /&gt;
&lt;br /&gt;
*assertValue is used to check an HTML radio button&lt;br /&gt;
**The command needs two arguments Target and Value&lt;br /&gt;
***The Target is a locator&lt;br /&gt;
****Note that locators can be found by clicking the Select button&lt;br /&gt;
*****The Select button is after the Target box in the IDE&lt;br /&gt;
****Then go to Firefox and choose the correct element&lt;br /&gt;
*****The elements are highlighted as the mouse arrow passes over them&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
   An input radio button is given by an HTML input tag with a type of radio&lt;br /&gt;
   The input radio button tag looks like the following in HTML&lt;br /&gt;
    &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;gender&amp;quot; value=&amp;quot;female&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This image shows the command for using assertValue to test a radio button&lt;br /&gt;
[[File:Assert_radio.png | An assertValue Command in Selenium IDE]]&lt;br /&gt;
&lt;br /&gt;
*The Selenium IDE Reference says the following&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
assertValue(locator, pattern)&lt;br /&gt;
Generated from getValue(locator)&lt;br /&gt;
    Arguments:&lt;br /&gt;
        locator - an element locator&lt;br /&gt;
    Returns:&lt;br /&gt;
        the element value, or &amp;quot;on/off&amp;quot; for checkbox/radio elements&lt;br /&gt;
    Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). &lt;br /&gt;
    For checkbox/radio elements, the value will be &amp;quot;on&amp;quot; or &amp;quot;off&amp;quot; depending on whether the element&lt;br /&gt;
    is checked or not.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*The locator is expected to be of one of the locator types i.e. xpath, id, name, css, etc.&lt;br /&gt;
*The pattern is expected to be the values of either on or off (not true or false)&lt;br /&gt;
*The value of the radio button is compare to on or off&lt;br /&gt;
**On indicates that the radio button is checked&lt;br /&gt;
**Off indicates that the radio button is not checked&lt;br /&gt;
***Command fails if they are not equal&lt;br /&gt;
***Command succeeds if they are equal&lt;br /&gt;
*Note that the check is whether the radio button is checked or not&lt;br /&gt;
**It could be either and if it is not checked and is compared to on&lt;br /&gt;
***Then the assert fails&lt;br /&gt;
&lt;br /&gt;
===Assert on Drop Box Option Choice===&lt;br /&gt;
&lt;br /&gt;
*assertSelectedValue is used to check an HTML drop down selection&lt;br /&gt;
**The command needs two arguments Target and Value&lt;br /&gt;
***The Target is a locator&lt;br /&gt;
****Note that locators can be found by clicking the Select button&lt;br /&gt;
*****The Select button is after the Target box in the IDE&lt;br /&gt;
****Then go to Firefox and choose the correct element&lt;br /&gt;
*****The elements are highlighted as the mouse arrow passes over them&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
   An select dropdown is given by an HTML select tag&lt;br /&gt;
   The select tag looks like the following in HTML&lt;br /&gt;
    &amp;lt;select name=&amp;quot;selectBox1&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;option value=&amp;quot;volvo&amp;quot;&amp;gt;Volvo&amp;lt;/option&amp;gt;&lt;br /&gt;
      &amp;lt;option value=&amp;quot;saab&amp;quot;&amp;gt;Saab&amp;lt;/option&amp;gt;&lt;br /&gt;
      &amp;lt;option value=&amp;quot;mercedes&amp;quot;&amp;gt;Mercedes&amp;lt;/option&amp;gt;&lt;br /&gt;
      &amp;lt;option value=&amp;quot;audi&amp;quot;&amp;gt;Audi&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;/select&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This image shows the command for testing a select dropdown&lt;br /&gt;
[[File:Assert_select_dropdown.png | An assertSelectValue Command in Selenium IDE]]&lt;br /&gt;
&lt;br /&gt;
*The Selenium IDE Reference says the following&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
assertSelectedValue(selectLocator, pattern)&lt;br /&gt;
Generated from getSelectedValue(selectLocator)&lt;br /&gt;
    Arguments:&lt;br /&gt;
        selectLocator - an element locator identifying a drop-down menu&lt;br /&gt;
    Returns:&lt;br /&gt;
        the selected option value in the specified select drop-down&lt;br /&gt;
    Gets option value (value attribute) for selected option in the specified select element.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*The locator is expected to be of one of the locator types i.e. xpath, id, name, css, etc.&lt;br /&gt;
*The pattern is expected to be the value of one of the options in the select dropdown&lt;br /&gt;
*The value of the select dropdown is compare to the pattern&lt;br /&gt;
**Command fails if they are not equal&lt;br /&gt;
**Command succeeds if they are equal&lt;br /&gt;
&lt;br /&gt;
===Assert on Element Attribute===&lt;br /&gt;
&lt;br /&gt;
*assertAttribute is used to check an attribute of an HTML element&lt;br /&gt;
**The command needs two arguments Target and Value&lt;br /&gt;
***The Target is a locator&lt;br /&gt;
****Note that locators can be found by clicking the Select button&lt;br /&gt;
*****The Select button is after the Target box in the IDE&lt;br /&gt;
****Then go to Firefox and choose the correct element&lt;br /&gt;
*****The elements are highlighted as the mouse arrow passes over them&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
   An example of a form where the title attribute is to be checked&lt;br /&gt;
        &amp;lt;form id=&amp;quot;searchbox_016909259827549404702:hzru01fldsm&amp;quot; action=&amp;quot;http://www.google.com/cse&amp;quot;&lt;br /&gt;
          title=&amp;quot;seleniumhq.org Selenium Search&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div&amp;gt;&lt;br /&gt;
            &amp;lt;label for=&amp;quot;q&amp;quot; title=&amp;quot;Search SeleniumHQ.org&amp;#039;s sites for selenium content&amp;quot;&amp;gt;search selenium:&amp;lt;/label&amp;gt;&lt;br /&gt;
            &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;cx&amp;quot; value=&amp;quot;005991058577830013072:2lr_j6t3fko&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;cof&amp;quot; value=&amp;quot;FORID:&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;q&amp;quot; name=&amp;quot;q&amp;quot; accesskey=&amp;quot;s&amp;quot; size=&amp;quot;30&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;input type=&amp;quot;submit&amp;quot; id=&amp;quot;submit&amp;quot; value=&amp;quot;Go&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This image shows the command for testing an attribute&lt;br /&gt;
**Note that testing an attribute of an element can prove that the correct page has been loaded&lt;br /&gt;
&lt;br /&gt;
*The following images shows the use of the assertAttribute command in the IDE&lt;br /&gt;
[[File:Assert_attribute.png | An assertAttribute Command in Selenium IDE]]&lt;br /&gt;
&lt;br /&gt;
*The Selenium IDE Reference says the following&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue;background-color:lightgrey&amp;quot;&amp;gt;&lt;br /&gt;
assertAttribute(attributeLocator, pattern)&lt;br /&gt;
Generated from getAttribute(attributeLocator)&lt;br /&gt;
    Arguments:&lt;br /&gt;
        attributeLocator - an element locator followed by an @ sign and then the name of the attribute, e.g. &amp;quot;foo@bar&amp;quot;&lt;br /&gt;
    Returns:&lt;br /&gt;
        the value of the specified attribute&lt;br /&gt;
    Gets the value of an element attribute. The value of the attribute may differ across browsers (this is the case for the &amp;quot;style&amp;quot; attribute, for example).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*The locator is expected to be of one of the locator types i.e. xpath, id, name, css, etc.&lt;br /&gt;
**With the @ symbol following and then the name of the attribute to compare&lt;br /&gt;
*The pattern is expected to be the string value of the attribute that is to be compared&lt;br /&gt;
*The value of the attribute is compare to the pattern&lt;br /&gt;
**Command fails if they are not equal&lt;br /&gt;
**Command succeeds if they are equal&lt;br /&gt;
&lt;br /&gt;
===Store a variable in the IDE===&lt;br /&gt;
*The IDE stores variables into a map by name/value pairs&lt;br /&gt;
*These variables can latter be used by notation ${variableName}&lt;br /&gt;
*They can also be used in eval commands such as assertEval or storeEval&lt;br /&gt;
**This requires using javascript&lt;br /&gt;
&lt;br /&gt;
*The image below shows the use of two store commands and two eval commands&lt;br /&gt;
[[File:Store_commands.png | Store Commands in Selenium IDE]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;storeAttribute&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*The command takes two arguments&lt;br /&gt;
**The element locator followed by the attribute name in the form -- @attributeName&lt;br /&gt;
**The name of the variable in which to store the attribute value&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;storeBodyText&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*The command takes one argument&lt;br /&gt;
**The name of the variable in which to store the body text&lt;br /&gt;
***Note that this will only store the text of the body not any elements that a in the body&lt;br /&gt;
&lt;br /&gt;
===Assert on a variable in the IDE===&lt;br /&gt;
*First a variable must be stored using one of the store commands or storeEval&lt;br /&gt;
*Then the variable can be used using the notation ${variableName}&lt;br /&gt;
*Note that the variables are stored in a map called storedVars by the IDE&lt;br /&gt;
**A map has name/value pairs.  Give it the name and you can get back the value&lt;br /&gt;
&lt;br /&gt;
*The image below shows the use of variables in assert commands in the Selenium IDE&lt;br /&gt;
[[File:variables.png | Using variables in Selenium IDE]]&lt;br /&gt;
*Note that it might be hard to assert on the bodytext since the body text might be quite large and changing often.&lt;br /&gt;
**The locator in the store command //body could instead be some other locator such as a //div&lt;br /&gt;
***For example: //div[@style=&amp;quot;color:red&amp;quot; and @height=&amp;quot;80&amp;quot;]/text()&lt;br /&gt;
****get the text within the div tag for the two attributes specified&lt;br /&gt;
&lt;br /&gt;
===Evaluate on a variable in the IDE===&lt;br /&gt;
*There are three eval commands storeEval, assertEval, and verifyEval&lt;br /&gt;
**These usually require JavaScript as the first argument&lt;br /&gt;
**The second argument depends on the command&lt;br /&gt;
***In storeEval the second argument is the variable name in which the eval result will be placed&lt;br /&gt;
***In assertEval and verifyEval the second parameter is the value with which the eval result will be compared&lt;br /&gt;
&lt;br /&gt;
*The image below shows eval commands in the Selenium IDE&lt;br /&gt;
[[File:Eval_commands.png | Eval commands in Selenium IDE]]&lt;br /&gt;
&lt;br /&gt;
*Note the switch to JavaScript in the first argument of the eval commands&lt;br /&gt;
&lt;br /&gt;
===Assert on some text in an element===&lt;br /&gt;
*See the above section where a test has been done to see if a certain word appears in the text&lt;br /&gt;
**It uses the JavaScript String function indexOf once the text has been stored in a variable&lt;br /&gt;
***Note that the locator could have been for any element with text i.e. a div element&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
::[http://release.seleniumhq.org/selenium-core/1.0.1/reference.html Selenium Reference]&lt;br /&gt;
::[http://www.tutorialspoint.com/selenium/selenium_selenese_commands.htm TutorialsPoint on Selenese]&lt;br /&gt;
::[http://www.w3schools.com/js/ JavaScript Tutorial W3Schools]&lt;br /&gt;
::[http://www.tutorialspoint.com/javascript/ JavaScript Tutorial TutorialsPoint]&lt;/div&gt;</summary>
		<author><name>Ksolis</name></author>
	</entry>
</feed>