GUI Testing and Rational Robot Jerzy.Nawrocki@put.poznan.pl Models and Analysis of Software Lecture...

Post on 26-Mar-2015

216 views 0 download

Tags:

transcript

GUI Testing and Rational RobotGUI Testing and Rational Robot

Jerzy.Nawrocki@put.poznan.plwww.cs.put.poznan.pl/jnawrocki/models/

Models and Analysis of SoftwareLecture 1

Copyright, 2003 Jerzy R. Nawrocki

IntroductionIntroduction

The main problemwith test-first coding

is GUI testing.[IEEE Soft]

Introduction – What is Rational Robot?Introduction – What is Rational Robot?

Baseline Baseline

Robot

Introduction – Rational Robot and test-first codingIntroduction – Rational Robot and test-first coding

Remarks:

• When you start testing an application is ready.

• Rational Robot is for regression testing, not for test-first coding.

• The only chance for test-first coding is SQABasic.

Testing HTML ApplicationsTesting HTML Applications

StartBrowser [ URL$, ] [ WindowTag= Name$ ]

• Starts the browser,• enables HTML testing, and • loads a page if specified.

Web page address

Identifies this instance of the browser

StartBrowser "http://www.cs.put.poznan.pl/jnawrocki/models/", "WindowTag= Parent"

Testing HTML ApplicationsTesting HTML Applications

Browser action$, recMethod$, parameters$

• Performs an action on a Web browser

Back, Forward, NewPage, SetFrame,

CloseWin, ..

Wait= % default

time is 30s

Browser NewPage, ""

HTMLTitle=$, Name=$,

"" ..

Wait for the topmost frame

Testing HTML ApplicationsTesting HTML Applications

HTML action%, recMethod$, parameters$

• Performs a mouse action on an HTML tag.

Click, .. Coords= x, y

HTML Click, "Name= Autor", "Coords= 10,12"

HTMLTitle=$, Name=$,

"" ..

ExampleExample

ExampleExample

ExampleExample

NAME= "komendy"

NAME = "tablica”

NAME= "Ogloszenia"

Dodaj ogłoszenieTablica ogłoszeń

ExampleExample

NAME= "komendy"

NAME = "tablica”

NAME= "Data"

NAME= "Autor"

NAME= "Tekst"

NAME="Submit" NAME="Reset"

Dodaj ogłoszenieTablica ogłoszeń

ExampleExample

Sub Main

Dim Result As Integer

 

'Initially Recorded: 03-03-12 08:56:25

'Script Name: test7

 ...........................

End Sub

ExampleExample

NAME= "komendy"

NAME = "tablica”

NAME= "Ogloszenia"

Dodaj ogłoszenie

Tablica ogłoszeń

ExampleExample

StartBrowser "C:\Jurek\Teaching\models\index.html", "WindowTag=WEBBrowser" Window SetContext, "WindowTag=WEBBrowser", "" Browser SetFrame,"Type=HTMLFrame;HTMLId=komendy","" Browser NewPage,"","" HTMLLink Click, "Type=HTMLLink;HTMLText=Dodaj ogłoszenie", ""

ExampleExample

NAME= "komendy"

NAME = "tablica”

NAME= "Data"

NAME= "Autor"

NAME= "Tekst"

NAME="Submit" NAME="Reset"

Dodaj ogłoszenieTablica ogłoszeń

ExampleExample

Browser SetFrame,"Type=HTMLFrame;HTMLId=tablica","" Browser NewPage,"","" HTMLDocument Click, "Type=HTMLDocument;Index=1", "Coords=25,14" InputKeys "{TAB}2002-12-31{TAB}J.Nawrocki{TAB}1.IV.03 nie ma wykladu z Mode" InputKeys "ls and Analysis of Software."

ExampleExample

NAME= "komendy"

NAME = "tablica”

NAME= "Data"

NAME= "Autor"

NAME= "Tekst"

NAME="Submit" NAME="Reset"

Dodaj ogłoszenieTablica ogłoszeń

ExampleExample

Browser SetFrame,"Type=HTMLFrame;HTMLId=komendy","" HTMLLink Click, "Type=HTMLLink;HTMLText=Tablica ogłoszeń", ""

ExampleExample

NAME= "komendy"

NAME = "tablica”

NAME= "Ogloszenia"

Dodaj ogłoszenieTablica ogłoszeń

ExampleExample

Browser SetFrame,"Type=HTMLFrame;HTMLId=tablica","" Browser NewPage,"","" Result = HTMLTableVP (CompareData, "Type=HTMLTable;Index=1", "VP=Weryfikacja autora") Result = HTMLTableVP (CompareData, "Type=HTMLTable;Index=1", "VP=Weryfikacja daty")

Baseline filesBaseline files

TestDatastore\DefaultTestScriptDatastore\TMS_Script\vp\test7.Weryfikacja autora.base.grd

SummarySummary

Test-first coding for GUI is a real Test-first coding for GUI is a real problem.problem.

Rational Robot is for regression Rational Robot is for regression testing, not for test-first coding.testing, not for test-first coding.

SQABasic is an interesting language SQABasic is an interesting language but it is not clear how to use it for but it is not clear how to use it for test-first coding of GUI.test-first coding of GUI.

Further research is necessary to Further research is necessary to solve the problem.solve the problem.

BibliographyBibliography

Using Rational Robot, Version Using Rational Robot, Version 2001.03.002001.03.00

SQABasic Language Reference, SQABasic Language Reference, Version 2001.03.00Version 2001.03.00

QuestionsQuestions??