Hi all , I am new at QTP I want a sample script to check
validation messages(For java script or VB script) for login
page with for web based application.. Any one can Help. I
have to complete it in two days I need urgent help..

Ex. if I want to check mail.yahoo.com
1 > If user doed not exist it display "Username does not exist"
2> if invalid Uname and password then it display" Invalid
Uname or pass"

3> Loing Sucssessfully.

I want to check this types of application by using data
table to give values of username and password..

Thanks

Answer Posted / amjad

Open()(It is a function to open the application)
Browser("Browser").Page("Gmail: Email from Google").WebEdit
("Email").Set "User id"
Browser("Browser").Page("Gmail: Email from Google").WebEdit
("Passwd").SetSecure "************"
Browser("Browser").Page("Gmail: Email from
Google").WebButton("Sign in").Click
If Window("gmail").Exist then
reporter.ReportEvent 0,"Checking Login","details given are
correct"
Window("gmail").close
Else
Browser("Browser").Page("Gmail: Email from
Google").WebButton("Sign in").Click
Browser("Browser").Page("Gmail: Email from
Google").WebButton("Sign out").Click
reporter.ReportEvent 1,"Checking Login","details given are
not correct"
end if

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

we add library file used in test via settings or through "ExecuteFile" command. when we implement framework do we make common library file and load the same for all the test cases execution?

1579


Where should i find checkpoint and virtual objects's Object properties and values in the QTP 9.2 Means where checkpoints or virtual objects related data will store If i want to get the runtime object properties how can i use Getroproperties on Checkpoints

1457


How to get the particular property value?

610


Hi All, How to get repeated word in string . Thanks Balaji

932


Where you get the run time data table?

578






How do you synchronization point through DP?

595


how u will evaluate the tool for test automation?

1368


how to download mercury qtp9.2 ny internet ?

2959


Connect to QC using AOM.

1233


explain how to write vb script in qtp?when will you write own script?

1853


i have two questions for regular expression :- Q1. I have date pattern eg-29/11/2011 29-11-2011 29.11.2011 Que- if any separator is there between date,month and year pattern should match else it should not match eg- pattern should not match in case of 2911-2011 Q2. let say i have a string and there is a number in between of that string eg.-Amount 30002.234 successfully credited to your account . now i have to match this pattern in such a way that even if decimal is not there pattern should match ,how i will do this using regular expression

1023


Explain the difference between data driven testing and parameterization ?

583


what is clean sweep?

1881


Can we create user defined functions in qtp?

551


can any body clearly explain about keyword driven framework .give me the explanation for files what ever you use in this frame work?

1686