VM1 = "Invalid username or password. Please
try again. "
VM2 = "Email id is required.Password is
required. "
VM3 = "Email id is an invalid e-mail
address.Password is required. "
VM4 = "Password is required. "
VM5 = "Email id is required. "
VM6 = "Email id is an invalid e-mail
address. "

'Rowcount of the Local sheet
Rowcount = DataTable.GetSheet("Invalid login
transactions").GetRowCount

'Valid emailid and Password
Emailid = "test@iteamic.com"
Password = "Password0"

'For i = 1 to Rowcount

'Parameterised Email_id
Browser("Browser").Page
("Page").WebEdit("emailAddress").Set DataTable("Email_id",
dtLocalSheet)
EID = Browser("Browser").Page
("Page").WebEdit("emailAddress").GetRoProperty("value")

'Parameterised Password
Browser("Browser").Page
("Page").WebEdit("password").Set DataTable("Password",
dtLocalSheet)
PWD = Browser("Browser").Page
("Page").WebEdit("password").GetROProperty("Value")


If EID = Emailid And PWD = Password Then
Reporter.ReportEvent micPass, "EID & PWD
check", "Email id and Password is correct, One iteration of
Invalid login attempts is not being executed"
Else Browser("Browser").Page("Page").WebButton
("Sign-In").Click

'Output value exported to the local
sheet
Browser("Browser").Page
("Page_2").Output CheckPoint("Home page_Sign in")

'Storing the output value in a
variable(OUTPUT
OUTPUT = Datatable.GetSheet
("Invalid login transactions").Getparameter
("Validation_message_signin").value

'comparing the Variable Output and
the Validation message for a given input

If OUTPUT = VM1 Then
Reporter.ReportEvent
micPass, "VM1", "Invalid username or password. Please try
again. "
else if OUTPUT = VM2 Then
Reporter.ReportEvent
micPass, "VM2", "Email id is required.Password is
required. "
else if OUTPUT = VM3 Then
Reporter.ReportEvent
micPass, "VM3", "Email id is an invalid e-mail
address.Password is required. "
else if OUTPUT = VM4 Then
Reporter.ReportEvent
micPass, "VM4", "Password is required. "
else if OUTPUT = VM5 Then
Reporter.ReportEvent
micPass, "VM5", "Email id is required. "
else if OUTPUT = VM6 Then
Reporter.ReportEvent
micPass, "VM6", "Email id is an invalid e-mail address. "
else Reporter.ReportEvent micFail, "EID &
PWD check_FAIL", "Validation message checkpoint failed. The
captured v msg is not required"
End if

End if



I am getting syntax error saying "Expected 'End If'" at the
last line, Why is this? Kindly explain...



VM1 = "Invalid username or password. Please try again. " VM2 = "Email id is re..

Answer / shantikiran

Hi, this is ShantiKiran from Pune...

in your above code, replace the "Else if" to "ElseIf"
and check it


Regards
ShantiKiran B

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More QTP Interview Questions

In qtp, how you can use xpath to identify objects?

0 Answers  


what is difference between analog and low level recording

2 Answers   Intel,


Where the text version of script file located in file system?

1 Answers  


Greetings friends , Hope all of you are doing well. When I run a test, is it possible for me to for me to take each row from the data table , once at a time. In other words,if i have 10 rows in the global data table, say data1,data2, data 3...and so on up to data10. Can I have the value of data1 when I run a test, and next time when I run the same test (say next day), it should skip data1 as it has already used it and go directly to data 2 ??? Would be great if anybody can help me out know in this issue. Thanks & Regards !!

4 Answers   CTS,


suppose u hav a dialog or window which contains 10 buttons with same name & value. now how to check each button? i.e. how qtp indetifies these objects separately?

2 Answers  






Hi all, On recording a particular Web application with QTP,Have came across a problem for which I havent found a solution so far.. The script of importance is as follows: Browser("Personalized Start Page").Page("XYZ").Frame ("mainFrame_4").Link("address.csv").Click Browser("Personalized Start Page").Page("XYZ").Sync Dialog("0% of dms.php from XYZ-").Dialog("File Download").WinButton("Save").Click My problem is that on recording the application with QTP and clicking the "address.csv" link another browser window comes up temporarily followed by the Windows "FileSave" dialog.The browser window which came up closes down when the Windows "FileSave" dialog is visible and I save the file to a windows location. On the "Record and Run" settings under Qtp,have activated settings for web and windows applications. But when I run this recorded script,and after the "address.csv" click,The browser window comes up and goes down,No Windows "FileSave" dialog comes up and the QTP shows the error Dialog("0% of dms.php from XYZ-") object is not found,though this object is there in the repository. Have tried putting the Dialog("0% of dms.php from XYZ- ").Exist property.But the "Exist" property is not recognised by the dialog at all. Any help in this direction is appreciated.. Thanks in advance J

1 Answers   ADP,


How to capture the tooltip of webelement,if there are two values displayed in tooltip of webelement?

1 Answers  


I Scheduled a QTP Script on remote desktop. Script is going to failure,when remote desktop connection fails.I have to open my remote desktop untile the scripts exection completes. If I disconnect my remote desktop connection, script is going to fail. Could you please any assist in this?

2 Answers  


what is the difference between quality and testing ?

2 Answers  


Diff b/w WEB TESTING AND Client server testing?

3 Answers   Ordain Solutions,


WHO TAKE DECISION TO RELEASE THE BUILD

2 Answers   IGT,


Hi friends I am new in Qtp. now i am Searching on Qtp give real time inter questions with answers.pls help me

1 Answers  


Categories