How to map test cases with Automation script?
Please explain in details.With example

Thanks for your co-operation(In Advance)

Answer Posted / niroj

Don't do a direct mapping with the TCs. Because it will be
very hard code, maintain and the test cases writing may
differ from person to person.
Hence,to this you need to first simplify the test cases with
some basic keywords like OPEN PoPup, OPEN WINDOW, ENTER
value AND PRESS <Enter>, MATCH value, CONNECT DB name,
EXECUTE QUERY(SELECT ...), WAIT secs etc. which you think
can completely represent any testing you are doing and other
people also can easily follow the same standard.
Put all these step wise perfect format in a file(better to
put in a Excel doc)

Now you can check your KEY words which can be read from the
Excel doc and match those using Regular Pattern Matching.
After mapping with the instructions we can execute the exact
codes in your automation script.

Example: Suppose I am going automate Web Page application.
Test cases step in original format:(i.e in an excel sheet)
I am using PERL pattern matching Standards...
1) Open the site yahoomail | Req: The page should be loaded
correctly
2) Enter your yahooid | Req: User should be able to enter
his/her name in the text field
etc...

Mapping Steps:(Re-writing TCs in a excel sheet)
1) OPEN PAGE "https://login.yahoo.com/" | Req: MATCH IMAGE
"Sign in to Yahoo!"
2) PRINT name@yahoo.com IN "Yahoo! ID" TEXTFIELD | Req:
EDITABLE FIELD
3) PRESS <Tab> | Req: BLIING CURSOR IN "Password:" FIELD
etc...
END_ME

Automation Coding Stage:
========================
Var Step=Read 1(Step column from Excel)
While Step <> END_ME
{
Var Task=ReadExcel [Step]["TASK_COL"]
Var Req=ReadExcel [Step]["REQ_COL"]
Var Step=ReadExcel [Step++]["Step_Col"]

If [ %Task% =~ /^\s*OPEN\s+PAGE\s+(\S+)/i ]
{
RUN IE
Wait Window to open
ENTER $1
Wait the page to load

If [ %Req% =~ /^\s*MATCH\s+IMAGE\s+(\S+)/ ]
{
Wait the image for searching
Set timeout=fewsecs
If matched:
Write Passed to a file
Else
Write Failed to a file
EndIf
}
...................
....................

}
..........................

}


========================================
Better you use a tool like WinAutomation, MacroSchedular etc
for easy mapping

Regards,
Niroj Kumar Pattnaik
R&D In Software Testing

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to access array data?

540


what do you mean .ota mobile format

1937


Why is the use of exit do or exit for statements within loops discouraged?

565


wht must be the interview question on corinthian information technology solutions incorporated.

2184


Explain about scrrun.dll?

528






Can any one provide code for Mid(string,start[,length]). I have been asked to write code for Mid(). i.e We need to define our own function say MyMid() which should behave same like built-in Mid function

1915


How will you get the largest subscript of an array in vbscript?

601


How to create a function in vbscript?

586


What is purpose of scripting.filesystemobject class in vbscript?

625


How to open excel in vb script?

568


How can you create a file object to work with the files in the vbscript language?

501


What is the use of the date function in the vbscript language?

560


Hi, Can anyone please send me vb script examples to practice vb and also material to learn vb scripting in QTP? my email id : hareen_11@yahoo.com

1812


please can you help me to get a code of flames using a visual basic 6

1226


For a webbased application:- what should be code in expert veiw, for retrieving a single column name "username" from a server and checking whether exported "username" from datatable doesn't exist in server. suppose i have saved in excelsheet a username="gayatri" , which is exported, then checked for whether this username "gayatri" exist in server database or not ? if exist then allow to enter new username, which should be again checked for in loop , or else come out of loop and enter a distinct "username". plz let me have this answer in my id gayatrisahooin@hotmail.com

1749