Content has been updated elsewhere, would you like to reload?

*** Warning: If you do not reload, you may be editing obsolete contents. This may cause you to lose recent changes.

Yes, reload    |    No, keep this older content
Overview
  • Selenium is a powerful software suite that lets you simplify and automate the testing of Web applications, through Firefox browser and script. This Web list focuses on first of its three components - Selenium "IDE" that runs as a Firefox browser add-on. Here are tutorials on installation, on usage, the "SideFlow" extension to enable conditional looping, and array manipulation. (This list does NOT cover the other two components: Selenium "WebDriver" and Selenium "Server.") 

  • Selenium IDE is meant for simple, recorded, automated, straight forward, Web testing tasks, such as open Web page, login, and form-flling. More complicated works are usually done with Selenium "Web Driver" where you "drive" it with another script language, such as PHP or Python. But there are ways to add simple condition and arrays to Selenium IDE:

    • What is Selenium IDE (formerly Selenium Recorder)?
    • How can I download, install, and use it?
    • Where can I find tutorials and short videos about Selemium IDE?
    • How can I access Selenium IDE's menu? (Maximize its window).
    • How do I store variables?
    • What is the SideFlow extention that adds IF/WHILE looping capability?
    • How do I use arrays, push and retrieve data from arrays?

    This Web list does NOT cover the other TWO major Selenium components:

    • Selenium "WebDriver" (formerly "RC") which lets you integrate your favorite server-side scripting languages into your tests),
    • Selenium "Server."
  Dishes  - Installation, Tutorials, Docs
  • Dish 1 : Learn to use Selenium IDE in just 2 Minutes! | YouTube.com

  • This 2-minute video demos how you can use Selenium IDE to automate a very basic search:

    • open Google page,
    • type a search word into the search box, and
    • click the search button to get the search results.

    View and pause the video, follow the steps, backstep and repeat if unclear ... and you are on your way to completing your first Selenium task!

  • This video demonstrate, how you can use Firebug with Selenium IDE to record testcases for your Web application. This technique can be used with JavaScript fr...
  • Dish 6 : Selenium IDE Tutorial – Part 1 | codediesel.com

  • Selenium IDE Tutorial – Part 1

    • STEP 1 – installation :
    • STEP 2 – running a simple test :

    Learn to use:

    • "clickAndWait" command
    • the "log" window as a console to view what is running.
    • the "assertTextPresent" to check if a text exists.

    (Part 2 is obsolete as Delicious.com has changed its HTML page.)

  • Here is a possible scenario for using Selenium. Imagine you have created a HTML form with about twenty fields and you have to repeatedly test the form. Filling the form every time can quickly become tedious. With Selenium you can automate the whole process and run the test as required. In this part we will see how to create a simple test in Selenium.

  • Dish 14 : How to use Locators in Selenium IDE | guru99.com

  • A clear tutorial focusing on how to find HTML elements using various approaches:

    •  ID
    •  Name
    •  Link Text
    •  CSS Selector
      •   Tag and ID
      •   Tag and class
      •   Tag and attribute
      •  Tag, class, and attribute
      •  Inner text
    •   DOM (Document Object Model)
      •   getElementById
      •   getElementsByName
      •   dom:name
      •   dom:index
    •  XPath

  • Locators defines properties of GUI elements like text buttons, check boxes and Text box for selenium IDE. Identification of correct GUI element is a pre-requisite to create an automation script.
  Chops  - Store, SideFlow, Loop, Array
  • Chop 4 : 51 Elliot: Selenium IDE Flow Control - Goto and While Loops | 51elliot.blogspot.com

  • This article introduces the popular SideFlow extension to enable Selenium IDE to handle conditional loops (IF/WHILE). The GitHub page is: https://github.com/73rhodes/sideflow

    There are helpful qustions and answers about looping in the comments section on this page.

    "This extension provides goto, gotoIf and while loop functionality in Selenium IDE. Selenium IDE is a plugin for Firefox that automates the testing of web-based applications. There is an excellent flow-control extension at wiki.openqa.org/display/SEL/flowControl for the Selenium RC and TestRunner components, but it does not work with Selenium IDE (the Firefox plugin) directly. ...

    I've ported the existing control-flow extension to work in the Selenium IDE Firefox add-on. The image below shows a sample test case using goto, gotoIf and a while loop, all running successfully in Selenium IDE."

  • Chop 5 : sideflow - Flow control extension for Selenium IDE - 73rhodes/sideflow | github.com

  • Lets you do goto and while loops in the Selenium IDE Firefox add-on. This is a Selenium IDE compatible port of the flow control extension from http://wiki.openqa.org/display/SEL/flowControl.

    Commands

    • label | mylabel - creates a label called "mylabel" (a goto target)
    • goto | mylabel - goto "mylabel"
    • gotoLabel | mylabel - synonym for goto
    • gotoIf | expression - jump to specified label if expression is true
    • while | expression - loop while expression is true
    • endWhile - indicate the end of a while loop
    • push | value | arrayName - push value onto an array, creating array if necessary

    There are 2 ways to set values into an array

    1. push | value, string, or a JSON-like item | array
    2. storeEval | new Array('a','b','c') | myarray

    If you are passing variable names, make sure to enclose in single quotes, eg,

    storeEval | new Array('${v1}','${v2}','${v3}') | myarray

  • sideflow - Flow control extension for Selenium IDE
  • Chop 6 : 51 Elliot: Selenium IDE Sideflow Update 2 | 51elliot.blogspot.ca

  • "To provide a simple way for users to build a collection, I added the "push" command. In Selenese, 'push' works like you'd expect in JavaScript, except it will automatically create the array for you if it doesn't already exist."

    [Push data into array]

    So, to build up a collection, you can do this:

    getEval | delete storedVars['mycollection']
    push    | {name: 'darren', status: 'groovy'} | mycollection
    push    | {name: 'basil', status: 'happy'}   | mycollection

    Note the use of 'getEval' to clear the collection first. Unlike 'runScript', 'getEval' runs in the context of the Selenium object, allowing us to modify storedVars.


    [Get data from array]

    To do something with every item in the collection (like foreach), you can do this:

    storeEval | storedVars['mycollection'].length | x
    echo      | mycollection has ${x} items
    while     | storedVars['x'] > 0
    storeEval | storedVars.mycollection[${x}-1]   | temp
    echo      | ${temp}
    storeEval | ${x}-1                            | x
    endWhile

  • Chop 15 : "[error] Threw an exception: missing ; before statement" and "[error] Threw an exception: unterminated string literal" = Selenium IDE and Javascript errors | comments.gmane.org

  • These do not work:

    • javascript {"${orderId}".match(/OrderId:\s*(\d+)/)[1];}
    • javascript{storedVars['p2'].replace('a','zz')}

    These work:

    • "${orderId}".match(/OrderId:\s*(\d+)/)[1]
    • '${p2}'.replace('a','zz')

    • storedVars['p2'].replace('a','zz')

    Some times, a HTML break (<br />) is rendered as new line (\n) by the browser, and Selenium IDE has trouble storeEval the text in Javascript array because of this new line character. It throws this error: 

    • [error] Threw an exception: unterminated string literal

    To delete NEW LINE character, first escape the var, replace "%0A" with blank string, then unescape back:

    • This does NOT work:   storedVars['has_new_line'].replace('\\n','')
    • This DOES work:         unescape(escape(storedVars['has_new_line']).replace(/%0A/g,''))

    The above escapes the string including the new line (\n) character (to become %0A), then replace it with blank string, throughout the string, using regular expression, then unescape back to get the original string (without the new line character).

  Desserts
  References and More

You are welcome to

  • Sign in through   Sign in or sign up with your Facebook account   Sign in or sign up with your Google account   Sign in or sign up with your Amazon account
  • Create your own Web list!
  • Save this into your reading list.
  • Write a comment below.
  • Share this Web list through email or with other Readish users.
      
Course info
  Comments
14  25  0  22  0
      
Language: EnglishThis course is owned by Durio
By Durio

 For Readish.com
Suggested courses    Hide
 For Readish.com
  • Move to:
  •    
       
       
       
Open All         >>