Sunday, December 21, 2014

Generate Selenium UI tests into a Custom format

  1. Install Firefox
  2. Install Selenium plugin for firefox [1]
  3. Start a firefox browser and start selenium IDE. (tools> Selenium IDE)
  4. Goto Options>Options>Formats of Selenium IDE user interface.
  5. Select one from the list of formats which is closely related to your test platform.
    1. ex: select Java/Junit4/Webdriver and click on source.

  1. Copy and save the code from Selenium IDE Format Source to a local location and close the window.
  2. Click on Add in Selenium IDE Options
  3. Give a proper name for the new format (ex: Jave/ CustomJunit/ WebDriver)
  4. Copy the content of the step 6 in to the “Selenium IDE Format Source” window.
  5. Save and restart the Selenium IDE.
  6. You can edit this template as per your preference. Edit relevant formating as mentioned in below image. 
    1. change package name
    2. add/remove imports
    3. etc


  7. Now you are done with a custom format for your test generation. 
    Perform UI actions you need to add in your test case.Now you will see that those actions get recorded in Selenium IDE. [2]
  8. Now File> Export Test Case as> Jave/ Custom/ WebDriver
  9. Save the test-case into your test project and execute it 



[1] http://docs.seleniumhq.org/projects/ide


No comments:

Post a Comment

Designed ByBlogger Templates