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

How to capture the Check point Value into a variable?

2 Answers  


What is the latest version in QTP?

55 Answers   Bharti, Polaris, US Technology,


What is the process of synchronizing qtp and aut?

0 Answers  


How do you done Data-Driven Testing using MS-Word. What is the script for that

3 Answers   IBM,


Any one knows about descriptive programming to identify objects in a page? Kindly drop me mail prasanna.sabat@gmail.com

3 Answers  






How can I replace all the text from the QTP script with some other text. Is there any replace all function in QTP Any one can help me

5 Answers   Livetek, Virtusa,


Hi guys, can anyone explain me whats the method for reporting the QTP test results to teamlead or non-QA member (developer/PM)? Thanks in Advance!!!!!

2 Answers  


tell me exact differenceb bw qtp and selenium?(could not tell open soure and licennce? difference in usage and technical difference?

0 Answers  


Hi, I am new into the field of testing and I need to know how can I begin automating the testing of Mainframe applications using QTP. Can anyone help me?

0 Answers  


how to retrieve the value from data table to the script and using the value to be displayed in message box. an also retrieve the value of the output value during runtime to the script or separating and using that value in the script.

1 Answers  


how can i call an external action,which is not added external action of an action?

2 Answers   Ordain Solutions,


In QTP, Give the difference of Global sheet and Local sheet in datatable?

3 Answers  


Categories