Friday, 27 April 2012

Example - Running selenium2 scripts from the Hudson dashboard

Aim: Hudson with selenium2

Difficulty Level: High

Pr-requisites:
  • JDK and Ant should be configured
  • Hudson should be installed
Steps:
  • Download the project from the link
  • You will get a war file, place it in C drive
  • Open command prompt and go to C drive
  • Run the command "java -jar hudson.war". (By default it will run on port 8080, if this port is busy then run command on other port i.e. "java -jar hudson.war --httpPort=8082")
  • Launch the  firefox and open the hudson dashboard using URL "http://localhost:8080"
  • Create a new job
  • Enter the job name
  • Select the Build Type ANT into the dropdown
  • Enter the target name from build.xml file into Targets field
  • Click on Advanced button
  • Enter the path of build.xml file into the Build of the field
  • Click Save button
  • Start selenium server.
  • Click Build Now link at hudson interface to build the project
  • Script runs and launches the browser
  • Open the build link
  • See the result from console output

Helpful Video:

sel2hudson by time2test


Thursday, 26 April 2012

iPhone using Selenium2 Webdriver API on MAC OS/ XCode environment

Aim: How to test a web application into an iPhone using Selenium2 Webdriver API on MAC OS/ XCode environment.

Difficulty Level: Hard


Pre-Requisites:
  • Selenium2 API responsible for iphone Webdriver
  • Installed xcode on MAC machine
  • Launching selenium/iphone/iWebDriver.xcodeproj in installed xcode
Steps to implement:
  • Go to the MAC PC
  • Download xcode4.2 and install
  • Launch the xcode once it is installed, popup opens
  • Select iWebdriver project option
  • Do Build and Run
  • Simulator starts
  • Download the Selenium 2 API using URL more specific to iphone testing:http://code.google.com/p/selenium/downloads/list
  • Create a selenium project directory using testNG, ant integrated
  • Open command terminal
  • Run the target using ant in same terminal
  • Check your script would run into the iphone simulator
  • Find the report into the test-output folder
Video Captures below points:
  • Open Xcode
  • Launching iphone simulator using iWebdriver
  • Running ant target defined into the build.xml file into the selenium2 project directory
  • Running of script into the iphone simulator
  • generated report from the test-output folder

Helpful Video:


IphoneVideo by time2test