Posts

Selenium Webdriver With Python

Basic Example import unittest from selenium import webdriver class Login ( unittest . TestCase ): def setUp ( self ): self . driver = webdriver . Firefox () def tearDown ( self ): self . driver . quit () def test_login ( self ): driver = self . driver driver . get ( 'http://testurl' ) username = driver . find_element_by_name ( 'user_id' ) username . send_keys ( 'admin' )     Selecting element from drop down list el = driver.find_element_by_id( 'id_line' ) for option in el.find_elements_by_tag_name( 'option' ):      if option.text = = "line to select" :          option.click()          break Verifying Table Values #Importing selenium webdriver library  from selenium import webdriver #Creating an driver instance of Firefox browser driver = web...

Test Automation with Cucumber & Capybara

Image
We will introduce today Capybara an higher level ATDD testing framework which support for multiple backends, supports Selenium and works in multiple browsers. The advantage of using Capybara over selenium is being on higher level than selenium , it can be used for other types of automation beside browser automation without changing the user facing simple and intuitive DSL. Let’s take for example a simple scenario of typing strings to an input textbox: Selenium-webdriver snippet require 'selenium-webdriver' element = driver.find_element :name => "q" element.send_keys "Cucumber tests" Capybara snippet require 'capybara' fill_in "q" , "Cucumber tests" The difference is clear in terms of simplicity and user friendliness which sets apart capaybara from selenium webdriver.Below is complete example for the reference starting from setting up the folder structure. I. Base Folder ...

Cucumber Basics Tutorial

In every cucumber project , first of all there should be root folder which will be a placeholder for all the cucumber files. For every cucumber project there is a single directory at the root of the project named " features ". This is where all of your cucumber features will reside. In this directory you will find additional directories, which is step_definition and support directories What is "Feature File"? Feature File consist of following components - Feature : A feature would describe the current test script which has to be executed. Scenario : Scenario describes the steps and expected outcome for a particular test case. Scenario Outline : Same scenario can be executed for multiple sets of data using scenario outline. The data is provided by a tabular structure separated by (I I). Given : It specifies the context of the text to be executed. By using datatables "Given", step can also be parameterized. When : "When" specif...

How to Setup Cucumber with Ruby

                                                       1. Ruby 1.9.3 Download and install the following version in separate root directory.   Last Stable Version: Ruby 1.9.3-p545:   http://dl.bintray.com/oneclick/rubyinstaller/ruby-1.9.3-p545-i386-amingw32.7z?direct Verification:   C:\Ruby193:> ruby –v In case of successful installation, it will show the installed version of the ruby on the system as below: 2. Ruby Dev Kit Download & Installation For Windows 7 -64 Bit   https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe Steps To configure RDK After Download: 1.:>ruby dk.rb init 2.:>ruby dk.rb install Verification: ...

Best Test Management Tool

Image
  Is there such thing as single best test management tool?                                                                                        “Quality is free, but only to those who are willing to pay heavily for it.” – T. DeMarco What is the best test management tool?   The right answer is it depends. As with everything in life there is no black or white answer to it as it depends on number of factors. First of all what is Test management??? Test Management encompasses anything and everything that we do as testers.   Our ...