How do I automate UI testing using selenium?

automate UI testing

Hi @rahulr,

Yes selenium are often wont to automate the manual interaction steps.

It’s intended to be used against web browsers and it’s widely used and implemented.

However this is often only half the puzzle. Selenium is that the core technology in browser automation tools, APIs and frameworks. to truly USE selenium you’re getting to got to pick an actual implementation.

You can start of with the IDE plug-in for Firefox. this is often nearly always mentioned as a fast and dirty, temporary solution. It doesn’t got to be. If you employ it to record existing interactions and check out and play them back, or do selections supported text, then yes, the test suites you create are going to be brittle. If you employ good practices like css ID’s and HTML data-attributes you’ll create robust and sophisticated automation this manner . It also has the advantage of actually letting you, or maybe your product team, see the automation for themselves. it’s the downside of only running within the browser IDE that it’s implemented which i think remains just Firefox so starting it’s still a manual step.

The other, more extensive and maintainable options is to use Selenium from within test framework like Ruby On Rails with Rspec and Capybara which enable you to write down scripts which may be run headless and against different browsers. This approach has the downside of not showing you the particular screens which could have visual layout issues.

Programming Languages & Frameworks

Languages are supported through drivers with commands from the Selenium API as methods/functions.

Testing frameworks which will be used with Selenium:

  • C# - Frameworks: NUnit Haskell

  • Java - Frameworks: JUnit, TestNG

  • JavaScript

  • Objective-C

  • Perl

  • PHP - Frameworks: Behat + Mink, Yii

  • Python - Frameworks: unittest, pyunit, py.test, robot framework

  • Ruby - Frameworks: RSpec, Test::Unit

1 Like