Selenium IDE Commands for Automation of Practice Form

1. There are 4 different Selenium Variants

First of all I would like to tell you that there are different variants of Selenium, so don’t get confused.

1. Selenium IDE - It’s a record and play tool, comes as plugin with Firefox only. No coding is required if you want to automate using this tool. But it can only be used for some very basic automation. As you cannot write your own logic or you won’t be able to put conditions or loops in your automation test script.

2. Selenium RC - RC stands for remote control. We have to write code using RC and it supports a number of languages. But it’s outdated now and there is no support available for RC.

3. Selenium Webdriver - Selenium Webdriver is web automation tool which can be used with different languages like Java, Python, C#, PHP, Ruby, Perl etc. It’s the successor of RC. Different architecture as what RC had (Not going in details).

4. Selenium Grid - Used for parallel execution of test cases (not an automation tool)

2. Selenium IDE Commands for Automation of Practice Form

In this section of the post, you will learn to automate most common actions that a QA perform quite often while web testing. 

General actions are: type, click on links, select dropdown option, multi-select, checking radio buttons and check boxes, uploading files and clicking on buttons, moving backward and scrolling. Above mentioned actions cover 90% of our testing. And it's fortunate to have Selenium IDE supports all these actions.

List of most commonly used commands of Selenium IDE:

CommandsDescription
openTo open URL
setTimeoutSetting Timeout Limit
windowMaximizeFor Window Maximizing
storeStoring value in variable
echoTo print/log custom messages in console
clickAndWaitClicking on link
goBackAndWaitTo navigate backwards
typeTo enter values in a text field
storeEvalExecuting Javascript / Scroll
clickChecking Radio Button / Check box
selectTo Select dropdown option
addSelectionFor multiple selection boxes
assertTitleTo verify title

Sample Script to automate "About Me" Web Form:

Practice Form
CommandTargetValue
open/automation-practice-form/
setTimeout10000
windowMaximize
storeSelenium Tutorials | Demo Form for practicing Selenium AutomationEXPECTED_PAGE_TITLE
echo"####### Clicking Link ########"
clickAndWaitlink=Link Test
echo"###### Using goBack command to navigate to previous page ######"
goBackAndWait
echo"###### Typing First Name and Last Name ######"
typename=firstnameDustin
typename=lastnameTaylor
echo####### Performing Scroll Action #########
storeEvalselenium.browserbot.getCurrentWindow().scrollTo(0,600)
echo"###### Check Radio Buttons & Check boxes #######"
clickid=sex-1
clickid=exp-3
clickid=profession-1
clickid=tool-1
echo"####### Performing File Upload Action #######
typeid=photoC:\Users\admin\Desktop\pic.jpg
echo####### Performing Scroll Action #########
storeEvalselenium.browserbot.getCurrentWindow().scrollTo(0,1000)
echo"####### Performing Select & Multi-Select Actions ########"
selectid=continentslabel=Australia
addSelectionid=selenium_commandslabel=Navigation Commands
addSelectionid=selenium_commandslabel=Switch Commands
clickAndWaitid=submit
echo${EXPECTED_PAGE_TITLE}
assertTitle${EXPECTED_PAGE_TITLE}
echo"###### PASSED - Test Completed Successfully #######"


3. Difference between Selenium IDE and Webdriver

First of all you should understand your automation needs and then only make a decision.
Let’s go through different variants of Selenium, this would make it easy for you to understand IDE and Webdriver.

1. Selenium IDE -
  1. It’s a record and play tool.
  2. Supports Firefox only: Comes as plugin with Firefox only, so not other browsers are supported.
  3. Coding is not required: if you want to automate using this tool. It will record your tests and generate html scripts for you.
  4. One can’t add coding logic in script: It can only be used for some very basic automation. As you cannot write your own logic or you won’t be able to put conditions or loops in your automation test script.
  5. No code re-usability: As we cannot create methods in ide scripts which are in html.
  6. Maintainability is quite high: Maintainence effort is quite high in IDE. If there are any changes in your application/software it would impact your automation scripts heavily.
  7. You can click on this link to see IDE sample script - Selenium IDE Sample Script With Most Commonly Used Commands
2. Selenium Webdriver -
  1. It requires coding.
  2. Open Source
  3. It supports Java, C#, PHP, Python, Perl, Ruby.
  4. Supports almost every browser: ff, chrome, ie, safari, opera.
  5. Cross Platform: Supports every platform like Windows, Linux, Mac.
  6. You can achieve code-re-usability.
  7. Automation maintainence effort is less.
  8. You can find Webdriver sample script here - First Selenium Webdriver Script

Happy Learning!

Overview & Features  << Previous      ||      Next >>  Selenium Demo Websites

Follow Us

Quora Space | Facebook Page | Telegram Channel
Feel free to ask queries or share your thoughts in comments or email us.

Comments

Popular posts from this blog

10 Best Demo Websites for Selenium Automation Testing Practice

Automate an e-Commerce website with Selenium Webdriver

How to Handle Dynamic Web Table in Selenium WebDriver

Top 50 Selenium Webdriver Interview Questions

Automate Browser Actions and Menu links with Selenium Webdriver

Top 25 Selenium Webdriver Commands for Test Automation