1

I am learning Selenium IDE and I am stuck on flow control. Can anyone advise me on how to master this concept? I would like reference on video, or documentation. Thank you

2
  • Google is a useful tool for looking up technical documentation. I Googled for "Selenium Flow Control Youtube" and found this. It's part of a series.
    – user246
    Sep 30, 2013 at 21:03
  • Can you elaborate on what you consider to be "flow control"?
    – djangofan
    Oct 31, 2013 at 16:09

4 Answers 4

3

I would argue that the Selenium IDE is not designed for creating more complex sequences as it relies on a number of assumptions about your application that may change and break your tests; Hardcoded IDs, strict structure dependence, and poor abstraction between operation (Click, Type, Click, Type, Click) and motivation (Login as Toby).

I would recommend using the Selenium IDE to quickly identify the testability of the webapp in question, before moving to another language such as Python, Ruby, Java etc and making use of the PageObjects pattern to create more robust tests whilst being able to leverage the power of the language you are using.

1
  • relies on a number of assumptions about your application that may change and break your tests; Hardcoded IDs, strict structure dependence, and poor abstraction between operation I disagree with this assertion. Hardcoding IDs is a poor practice not constrained to or demanded from Selenium IDE. Sure it's a primitive tool, but it does allow you to store an ID as a variable and reference that variable in subsequent locators. Strict structure dependency and poor abstraction also strike me as more PEBKAC style problems than problems with the Selenium IDE itself. edit:formatting Jun 25, 2014 at 19:23
2

I'm assuming that when you say flow control, you mean conditional statements, loops etc., There are many limitations as to what can be replayed through Selenium IDE. For example handling popups is not possible with IDE because the popup is not a html object and will not have any locator. It is an ActiveX object. Selenium IDE doesn't provide any flow control as well. For that you need to use Selenium Webdriver with either Java or C#.

Don't try to build tests using Selenium IDE and convert them to webdriver scripts, you will loose chance of building modular tests if you do so. If application changes in future, you will have to modify all your tests independently.

Your best bet is to use Selenium Webdriver with C#(or Java) and also use some test framework like NUnit(or JUnit), so that non developers can run the tests using NUnit GUI using simple interface, that is the best approach I found so far. You can use PageObject pattern to maintain object repository and write tests.

0

I would consider looking at Selenium Builder instead. Selenium IDE is a deprecated project I think.

2
  • 2
    Selenium IDE is a completely running project. Its not deprecated.
    – user6461
    Dec 4, 2013 at 9:59
  • 1
    While Selenium IDE is certainly not deprecated, it lacks a great deal of power/ability that you'd get with using Selenium within another programming language such as Java, C#, etc, etc. You can't do ODBC, nor can you do HTTP POST operations either. Selenium IDE is the quick and dirty approach to writing web tests.
    – Green
    Dec 4, 2013 at 19:59
0

Find Sauce Labs example here:


Below is a content from the article:

  1. Download the flowcontrol extension for IDE. (“Download” is a bit of a misnomer here, as the download link takes one to an HTML page. Simply copy/paste only the JavaScript contents of that page into a file named goto_sel_ide.js.)
  2. Download the 1.1 version of the includeCommand4IDE extension. (The just-released 1.2 version appears to have a serious bug.)
  3. Download the most recent version (0.2) of the datadriven.js extension. Install these 3 extensions in IDE via the Selenium Core extensionsfield (accessible via Options=>Options=>General). They must be specified in the order above!!!
  4. Re-start IDE so that all 3 extensions will get read in.
  5. Create an .xml file

     <testdata>
        <test linkText="How It Works" title="Sauce OnDemand: Cross browser testing with hosted Selenium testing in the cloud - Sauce Labs"/>
        <test linkText="Downloads" title="Sauce Labs Downloads"/>
        <test linkText="Pricing" title="Sauce Labs Pricing For Hosted Selenium in the Cloud"/>
       <test linkText="Support" title="Support: Sauce RC (Selenium RC) - Sauce Labs"/>
       <test linkText="Forums" title="Sauce Labs Forums"/>
       <test linkText="Blog" title="Selenium Testing? Do Cross Browser Testing with Sauce Labs"/>
       <test linkText="Flash/Flex Solution" title="Automate testing of your Flex and Flash Web Apps - Sauce Labs"/>
      <test linkText="Documentation" title="Documentation - Sauce Labs"/>
      <test linkText="About" title="About - Sauce Labs"/>
      <test linkText="Team" title="The Sauce Labs Team"/>
      <test linkText="News" title="Selenium News &amp; Events - Sauce Labs"/>
      <test linkText="Webinars" title="Webinars - Sauce Labs"/>
      <test linkText="Contact us" title="Support Contact - Sauce Labs"/>
      <test linkText="Service Status" title="Status - Sauce Labs"/>
    </testdata>
    
  6. linkText and title are variable names of my choice. You can use any names you want, and also any number of variables you want. The critical thing is that each container must contain all the data–input and output–for a single test case.

  7. View your .xml file in the browser to ensure that it does not contain any errors (only necessary if you did not use an XML editor to create the file).
  8. Utilize your .xml file via creating an HTML test case:

    loadTestData file:///Users/mamp/Desktop/BLOG/saucelabs-footer.xml open
    http://www.saucelabs.com while !testdata.EOF() nextTestData
    clickAndWait link=${linkText} verifyTitle ${title} goBackAndWait endWhile
    
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.