1.    Install Selenium IDE Firefox extension

- Firefox extension allows you to record and playback actions
- Allows the user to edit the source and save as various file types such as HTML, Ruby,
- Allows the user to select fields by name, id, supports xpath

Record and playback (html) file to verify it works.

2.    Install Selenium RC: http://selenium.googlecode.com/files/selenium-remote-control-1.0.3.zip

a.    Extract to C:\SeleniumRC folder, or anywhere you want to work with it

b.    Check Java on your machine. Open command prompt and enter

i.    Java –version (make sure you have 1.5 and above)

ii.      http://www.cs.mcgill.ca/~cs202/2009-01/other/jdk-configuration–vista.pdf

c.    First start the Selenium RC server by opening command prompt and enter:

i.     C:\>java -jar c:\SeleniumRC\selenium-server-1.0.3\selenium-server.jar –multiwindow

d.    Open a text file and enter the above command (without the C:\>) Then save as SeleniumRC.bat and you can run the server from your shortcut.

3.    Install Python at: http://activestate.com/Products/activepython/index.mhtml or http://www.pythonmac.org/

If you don’t know which version to use, start with Python 2.6.5; more existing third party software is compatible with Python 2 than Python 3 right now. Python 3 is backwards INCOMPATIBLE

a.    Set your environment so your command window knows to run it:

i.    set path=%path%;C:\python26

ii.    set path=%path%;C:\ python31

iii.    Open command prompt and type path to see paths set

iv.    Make directly executable by #! /usr/bin/env python in python script

v.    To run open command window and go to file: C:>python script.py or use PythonWin/IDLE

b.    Go to your SeleniumRC directory C:\SeleniumRC and open selenium-python-client-driver-1.0.1

c.    Copy the module with the Selenium’s driver for Python (selenium.py) in the folder C:/Python25/Lib (this will allow you to import it directly in any script you write).

4.    Go to Selenium IDE and export a test script to Python under :

a.    Options -> Export -> Python-Selenium RC.

b.    Save the file as .py

5.    To run your Python script with Selenium RC:

a.    Start Selenium RC server with java command above if it is not already started

b.    Open new command window and go to directory of Python script: cd C:\pythonautomation

c.    Enter script name to run: search.py

{ 0 comments }

Read in data from a file and replace the text using /replacetext./

urlfile= “C:\\printservers\\printurls.txt”
i=1
servermax = 4

File.open(urlfile, ‘r’) do |f1|
while line = f1.gets
result = {}
server,product1,durl,product2,lurl,product3,curl,product4,murl,product5,surl,product6,mpurl=

line.split(”,”)

while i <= servermax
server1 = server.gsub!(/print01-0./, “print01-0″+ “#{i}”)
f.puts “1. First verify server is up #{server1}”

$ie.goto(server1)
i= i+1
end

end

end

{ 0 comments }

An example to grab the first image loaded on a page and return the width and height.

$ie.goto(url)

width = $ie.image(:index,1).width
widthnum =  Integer(width) #Convert to integer.  #
if widthnum >50
f.puts “- SUCCESS: Width of image loaded: #{widthnum}”
else
f.puts “!!!!! WARNING: Did not find width for image on page !!!!!”
end

height = $ie.image(:index,1).height
heightnum = Integer(height) #Convert string to integer. #
if heightnum > 50 #height != nil (pixel version) #
f.puts “- SUCCESS: Height of image loaded: #{heightnum}”
else
f.puts “!!!!! WARNING: Did not find height for image on page !!!!!”
end

{ 0 comments }

Edit Cookies in Your Browser

November 12, 2008

Testing a site that contains values that target certain users or simply trying to figure out which is the best approach via A/B tests? To modify your browser cookies, there are some simple tools to make this happen.

Firefox

1. Install Firebug 1.2.X:
- Go to the web page you wish to view or set cookie
- Go to Firefox -> Tools Menu-> Open Firebug
- Inspect -> Cookies
- Right click to Edit

2. Another option is to install the add-on Web Developer for Firefox.
- Firefox -> Tools->Web Developer -> Cookies -> View cookies
- Edit cookie
- Go to page again
- Tools -> Web Developer -> Cookies -> View cookies
- You can also delete and refresh cookies

Firefox Web Developer

Firefox Web Developer

Internet Explorer

- Go to the web page you wish to view/set cookie

- Install the little program called IECookiesView

- Double-click to execute program

- In the upper pane of the program, click on the name of the website

- In the lower pane of the program, click on the name of the cookie you wish to edit.

- Right-click on the cookie name and choose option to edit

- Close IECookiesView and restart browser

- Navigate to the web page again

View IE Cookies

View IE Cookies

{ 0 comments }

Check it out

November 10, 2008

{ 0 comments }

LAMP – Linux, Apache, MySQL, and Perl/Python/PHP

November 4, 2008

The only open source web platform you need to know. LAMP stands for Linux, Apache, MySQL, and Perl, Python, or PHP technologies.
LAMP is an open-source Web development platform, also called a Web stack, that uses Linux as the operating system, Apache as the Web server, MySQL as the database management system, and [...]

Read the full article →

Software Quality Assurance Jobs

October 18, 2008

Top 10 sites to find Software QA Jobs:
Dice
Monster
Yahoo Hotjobs
Career Builder
Jobirn
Simply Hired
Craigslist
QA Jobs
Indeed
Linkedin

Read the full article →

Delete Cookies Using Ruby/Watir

October 1, 2008

1. In your Ruby script, require:
require ‘fileutils’
2. Set the path to your cookies, you can leave the ENV['USERNAME']
$cookieDir = “C:\\Documents and Settings\\#{ENV['USERNAME']}\\Cookies”
3. Call the file utility function to remove the cookies:
FileUtils.rm_rf $cookieDir

Read the full article →

Delete Cache and Cookies in Ruby

September 29, 2008

How do you clear out your browser cache and cookies from your Watir scripts? Create a ruby file del_cache.rb with the code below, then from your main testfile.rb require the file and call the function.
——————————————————————
#!/bin/ruby
#
#
#
#
#
# set TEMPIF=%USERPROFILE%\Local Settings\Temporary Internet Files
# %TEMPIF%\Content.IE5\Index.DAT
require ‘Win32API’
#
#
# HashMethods = a Hash that can be accessed with methods
#   e.g.    h = [...]

Read the full article →