Next Generation Functional Testing Tool
A typical TestWise project is a folder consisting of
The project file extension is .tpr, which stores the settings. The .tws in the same folder is workspace file, which stores your work settings (such as remembering last file you opened). It is recommended that not check in .tws file in your version control system.
If you are new to TestWise, the best place to start is the demo project (included in TestWise under samples\demo). Select File xE2x86x92 Open Project (^xE2x86x91O|xE2x8Cx98xE2x86x91O), and choose the c:\Program Files\samples\demo\demo.tpr (project file).
In TestWise, only one project can be opened at one time.
Using File xE2x86x92 New Project will bring up the window shown below.
You need to enter project name and project folder. If the folder already exists, TestWise will scan files with extensions described above (spec.rb, *page.rb, …). If in doubt, start with a new folder. Test files will be named with XXX_spec.rb or XXX_test.rb based on naming convention.
Here is a sample one.
You will see the following files created. Select hello_test.rb and click Run button on the Toolbar , you shall see an IE browser window starts up with your web site.
Now you shall have a project created and a sample hello_test.rb running. There are several ways to start adding new test files to the project.
Right mouse click selected file and select ‘rename’.
Right mouse click selected folder and select ‘New spec’ or ‘New test file’ (which suffix _spec or _test respectively).
Select an existing file, press F5 to create a new file with its content.
You can get to project setting dialog via Menu (‘Tools’→‘Project Settings’) or Ctrl+Alt+,.
The setting in ‘General’ Tab is pretty much self explainary. The second tab ‘Environments’ allows user to configure the host url for different environments (called servers in some organisations), so that users can run tests against different environments with simple switch.
The ‘Test Template’ and ‘Page Template’ Tabs are cutomizing the template test and page files.
Using Search xE2x86x92 Find in Project (^xE2x86x91F|xE2x8Cx98xE2x86x91F) will bring up standard search and replace window shown below.
Here you can search all (text) files in current project and do replacement selectively. ‘Replace selected’ is not supported when searching by regular expression.
You can quickly move to a file using Go to File … in the Navigation menu (^T|xE2x8Cx98T), this opens a window like below.
This window list all text files in the project alphabetically.
A test file often contains multiple test cases, and test cases may have descriptive (long) names. Go to Test Case in the Navigation menu (^xE2x86x91T|xE2x8Cx98xE2x86x91T) help you get to specific test case quickly. You might find yourself using it often.
A Function is a piece of scripts maybe reusable or make test scripts more readable.
For example, you might have the following script in
open_browser("http://www.TestWise.com/support") enter_text("user_name", "john") enter_password("password, "password") click_button("Login") click_link("feedback")
Now define login_as function in test_helper (if you follow TestWise convention, functions in test_helper.rb are available to all test files)
def login_as(username, password="password) enter_text("user_name", "john") enter_password("password, "password") click_button("Login") end
Then you can refactor (meaning: change for better without affecting functionality) origin test.
open_browser("http://www.TestWise.com/support") login_as("john", "password") click_link("feedback")
Now the test script is easier to read. Even better, if login function later changed in the application, you just need to update that function!
Go to Function in the Navigation menu (^xE2x86x91D|xE2x8Cx98xE2x86x91D) will take you quickly to the functions defined in the helper or page class files.
Recent files… in the Navigation menu (^E|xE2x8Cx98E) will show files you recently visited sorted by last use.