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...

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the concept of object repository?

524


Some time when i wanna learn the object i face issue like i am not able learn the object in proper manner... eg:for text bo on web page it should learn as webedit but some times it reads as winobject:internetexpoler-server, because of this i have to uninstall the qtp and re-install it again when i do this it reads the object perfectly.....plz suggest the soln

1386


How qtp recognizes the object?

663


What is checkpoints for qtp?

524


hi i am working with vbwindow on qtp.first i am openning qtp whenever open qtp my application not open that time generated error like "Runtime error 0" and fatal error:automation error how to solve this problem pls tell me

1866






How to analyzing test results using quicktest professional?

560


How to save your test using quicktest professional?

524


How to carry out bit map check points in QTP

1759


Can any one tell me how to write a script for selecting open option in File menu of A word document.here you have to add objects to OR.try like that and give me the ans.i asked this question to so many but no one knows.if any one know the answer plz let me know

1397


How you can find the absolute value of the number in qtp?

516


how to evalute defects in QTP script?

1480


If there is a change in the object type eg: A button is changed as link, 1. How to edit that in the shared object repository. 2.What options are available to edit the object within shared object repository other than copy from loca; 3.What would be the effect of the change in Coded Scripts within QTP and Functions stored in .vbs file which are loaded and used in QTP

1292


In qtp, how you can get the last character from a string?

549


What is the difference between local and shared object repository in qtp?

552


If a button named "CLICK" is recorded in low level recording mode , what will be the values stored for "name" property of that button in object repository ?

1735