Software Quality Assurance Methodology, Terminology, Tools, and More! Sharing, discussing, and simply blogging about the QA field. The latest tools that work, and some that don't. Code examples and script snippets that actually make sense and work! Bug trackers, product life cycle management, and much more...

Using WET to Run a Group of Watir Scripts

So what do I do with a bunch of stand-alone scripts in Watir/Ruby?

First, convert them over to use with WET.
- require "WET"
- include Watir
- take out strange symbols to print out such as <>
- Instead of writing results to a file using a loop and the file.puts command, change it to use reporter().ReportGeneral("instructions here")

1. Open up WET and click on the TEST icon

2. Select New

3. Click on the top and rename it (this name is used as the title in your results)
Example: Purchase Transaction Tests

4. Under Transactions, click on First Transaction and rename it.
Example : Purchase with credit
On the right hand side, select "choose" and choose the script file you want to use.

5.Go to the menu, add transaction

Writing Watir script results to a file using WET

Instead of using Watir's f.puts "text here" to your file, change that line to:

reporter().ReportAction("Action shows up in blue")
reporter().ReportGeneral("Text shows up in black")
reporter().ReportSuccess("Text shows up in green with a -Pass")
reporter().ReportFailure("Text shows up in red")

Run your script using WET, check out the HTML results file. Pretty neat huh? :)

Setting up WET with WATIR

WET can be used to manage and run WATIR scripts.

1. Install the latest version of WET:
- currently 1.0 as of 4/15/08

2. Install Ruby:
- currently 1.8.6 as of 4/15/08

3. Go to C:\ruby\lib\ruby\gems\1.8 and locate the Watir 1.4.1 directory (Watir 1.4.x automatically gets installed with WET).

4. Upload the latest Watir Gem, at this point 1.5.3 by opening your command prompt.
CMD> gem install Watir
This will install the latest Watir to your Ruby directory

5. To trick WET into using the latest version of Watir:
- back up the existing 1.4.x directory and name it something like Watire 1.4.1_real
- rename the latest Watir 1.5.X to 1.4.1

Getting Started with Silk Test

About Borland SilkTest
- Formerly Segue SilkTest (acquired 4/06)
- Intuitive GUI record-and-play capabilities
- Language: 4test
- Proprietary object-oriented, fourth-generation scripting language
- Offers commands, data types, and functionality from leading edge programming languages
- Uses standard ODBC access
- Built in Recovery system
- Errors logged during application crash
- Systems restored to pre-failure state and resumes testing
- Capabilities for cross-platform testing across a broad set of technologies
--> Web, Java or .NET, DHTML, XML, Java Applets, IE 6, IE 7, Firefox 1.5, Netscape 7 and more
- Requires Intel Pentium processor with 200MHz, 64 MB RAM, 60MB disk space

Setup
• Download and install the latest version of SilkTest

Starting with Silk Test Automation

SilkTest Projects
• SilkTest projects organize all the resources associated with a test set and present them visually in the Project Explorer, making it easy to see, manage, and work within your test environment.

• Projects store relevant information about a project, including references to all the resources associated with a test set, such as plans, scripts, data, option sets, .ini files, results, and frame/include files, as well as configuration information, Editor settings, and data files for attributes and queries.

• Since you need to configure the project only once, you can simply open the project and run your tests.

Some Basic QA Tools for Web Pages

The MarkUp Validator.
- Also known as the HTML validator, it helps check Web documents in formats like HTML and XHTML, SVG or MathML.

The Link Checker - Checks anchors (hyperlinks) in a HTML/XHTML document. Useful to find broken links, etc.

The CSS Validator - validates CSS stylesheets or documents using CSS stylesheets.

XML Schema Validator

Watir vs. Selenium

Found a great article comparing Watir and Selenium for QA automation tools. I'm not going to copy the text, but wanted to highlight some very good points!

Watir is a Ruby library that wraps the COM interface to Internet Explorer. COM is a long-standing Windows-based technology for making libraries accessible to various languages. This allows access to the Document Object Model (DOM) so it doesn't matter where on the page an object exists, what matters is how you identify it (id, name, title, etc).

Test out a Watir test case

Write a ruby file and save it as test.rb.
-------------------------------------------
require 'test/unit'
require 'watir'

class GoogleHomePage < Test::Unit::TestCase
def test_text_About_Google_exists
browser = Watir::IE.start "http://www.google.com"
assert(browser.text.include?("About Google"))
end
end
-------------------------------------------
Now open up the command prompt, navigate to where the file is located. Enter the filename at the command prompt to run it:

C:\>test.rb
Loaded suite C:/Documents and Settings/limited/Desktop/branches_test_unit/test_unit
Started
.
Finished in 1.687 seconds.

1 tests, 1 assertions, 0 failures, 0 errors

-------------------------------------------



Google




 









Syndicate content