Mustard functions - Hypothetical interpreter for GUI Testing
Here are the functions of the hypothetical interpreter "Mustard'.
MUSTARD FUNCTIONS
Login CLICK TAB SPACE ENTER TYPE CHECK EXEC
DELAY END BEGIN TYPEFILE
1. Login: Used for logging into a web page. The url of the web page should be stored in Url.txt. The X and Y co-ordinates of “username” text box should be stored after that.
An ideal url file (url.txt) would look as given below.
https://ps2332/S3Control/index.jsp
488 321
Work flow
Web page is opened with address https://ps2332/S3Control/index.jsp. In the login page, the point 488, 321 is clicked. This brings the cursor inside the “username” text box.
Now the username “A” is typed. TAB is pressed to go to “password” text box. Password “B” is typed. TAB is pressed to bring focus to “Login” button. The “Enter” key is pressed to login to the page.
Usage: Login A B
A= username
B= password
2. CLICK: The function is used for simulating mouse click on any point on the screen.
Usage: CLICK X Y
X= x co-ordinate of point to be clicked.
Y= y co-ordinate of point to be clicked.
3. TAB = Simulates pressing of TAB key.
4. SPACE = Simulates pressing of SPACE key.
5. ENTER = Simulates pressing of ENTER key.
6. TYPE = The function is used for simulating keystrokes from the keyboard.
Usage: TYPE ABC
The text “ABC” would be entered (say into a text box).
7. CHECK = Check if a window with specified caption contains the specified text
Usage: CHECK A B
Checks if a window with the caption “A” and text “B” exists. If the window exists, the test case is shown as passed (the name of the test case would be the test case in which the CHECK function is present) along with the date and time.
If the specified window does not exist, the test case is considered failed.
If a test case passes, an appropriate line is entered into “success.txt”.
If a test case fails, similar line is appended to “failure.txt”.
Note: Users of Winrunner may consider this similar to CHECKPOINT.
8. EXEC = Used for running an external program.
Usage: EXEC notepad.exe
This would run the notepad program.
9. DELAY= Used to make the automator wait for some time (in milliseconds)
Usage: DELAY X
X= Time in milliseconds.
10. TYPEFILE = Used to input multiple data items. This is used in conjunction with looping (BEGIN…END).
Type all data into a single text file. Each data entry should be separated by a new line.
Usage: TYPEFILE Users.txt
11. BEGIN= BEGIN is used along with END to simulate a loop.
Usage:
BEGIN 4 --------------------------------------> Begin the loop here.
CLICK 85 264//ADD NEW USER
DELAY 500
TAB //BRINGS CONTROL TO USERNAME
TYPEFILE Users.txt
TAB //FIRST NAME
TYPE MANOJ
TAB //LAST NAME
TYPE THARAYIL
TAB //EMAIL
TYPE manoj_tharayil@yahoo.com
TAB //ANALYTITIC PASSWORD
TYPE changeme
CLICK 51 489 //click on save.
DELAY 500
CHECK Add/Edit User
CLICK 455 442 // //TO CLOSE THE CONFIRMATION MESSAGE
END ----------------------------------> End the loop here.
MUSTARD FUNCTIONS
Login CLICK TAB SPACE ENTER TYPE CHECK EXEC
DELAY END BEGIN TYPEFILE
1. Login: Used for logging into a web page. The url of the web page should be stored in Url.txt. The X and Y co-ordinates of “username” text box should be stored after that.
An ideal url file (url.txt) would look as given below.
https://ps2332/S3Control/index.jsp
488 321
Work flow
Web page is opened with address https://ps2332/S3Control/index.jsp. In the login page, the point 488, 321 is clicked. This brings the cursor inside the “username” text box.
Now the username “A” is typed. TAB is pressed to go to “password” text box. Password “B” is typed. TAB is pressed to bring focus to “Login” button. The “Enter” key is pressed to login to the page.
Usage: Login A B
A= username
B= password
2. CLICK: The function is used for simulating mouse click on any point on the screen.
Usage: CLICK X Y
X= x co-ordinate of point to be clicked.
Y= y co-ordinate of point to be clicked.
3. TAB = Simulates pressing of TAB key.
4. SPACE = Simulates pressing of SPACE key.
5. ENTER = Simulates pressing of ENTER key.
6. TYPE = The function is used for simulating keystrokes from the keyboard.
Usage: TYPE ABC
The text “ABC” would be entered (say into a text box).
7. CHECK = Check if a window with specified caption contains the specified text
Usage: CHECK A B
Checks if a window with the caption “A” and text “B” exists. If the window exists, the test case is shown as passed (the name of the test case would be the test case in which the CHECK function is present) along with the date and time.
If the specified window does not exist, the test case is considered failed.
If a test case passes, an appropriate line is entered into “success.txt”.
If a test case fails, similar line is appended to “failure.txt”.
Note: Users of Winrunner may consider this similar to CHECKPOINT.
8. EXEC = Used for running an external program.
Usage: EXEC notepad.exe
This would run the notepad program.
9. DELAY= Used to make the automator wait for some time (in milliseconds)
Usage: DELAY X
X= Time in milliseconds.
10. TYPEFILE = Used to input multiple data items. This is used in conjunction with looping (BEGIN…END).
Type all data into a single text file. Each data entry should be separated by a new line.
Usage: TYPEFILE Users.txt
11. BEGIN= BEGIN is used along with END to simulate a loop.
Usage:
BEGIN 4 --------------------------------------> Begin the loop here.
CLICK 85 264//ADD NEW USER
DELAY 500
TAB //BRINGS CONTROL TO USERNAME
TYPEFILE Users.txt
TAB //FIRST NAME
TYPE MANOJ
TAB //LAST NAME
TYPE THARAYIL
TAB //EMAIL
TYPE manoj_tharayil@yahoo.com
TAB //ANALYTITIC PASSWORD
TYPE changeme
CLICK 51 489 //click on save.
DELAY 500
CHECK Add/Edit User
CLICK 455 442 // //TO CLOSE THE CONFIRMATION MESSAGE
END ----------------------------------> End the loop here.
Comments
Post a Comment