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
What are the 3 main stages involved in testing with qtp?
How to automate a script in mainframes environment? I have the terminal emulator Add in. Describe in detail.
How does qtp identify objects in the application?
Can QTP be used for GUI testing ?, We are using Java with MySQL and Operating system is Linux. We are NOT using the web.
What is the process of synchronizing qtp and aut?
Explain the types of properties that quick test learns while recording?
How to use Environment parameterization? Explain with an example.
What does mean by Scope of Automation?n How we defined it?
To which environments does quicktest professional (qtp) supports?
What is the extension of the qtp local repository?
what is the advantages and disadvantages of using functions instead of re usable actions
I need to obtain the parent of an object programatically, so if I have: winButton("aButton") I need to obtain the parent part: window("Window1").Dialog("Dialog1") so I can programatically create a string of the full name of the object to call it with an execute statement in QTP I would like to use something like: part[1] = "window(""Window1"")" part[2] = "dialog(""Dialog1"")" so I can do: exeLine = part[1]&"."&part[2]&"."&"winButton(""aButton"")" Execute exeLine Apart from keeping a record of the window/dialog hierarchy is there a parent or path function/ command Thanks Adrian
Where can I find and view run-time data table?
Which advantages helping QTP to hold the position of "Market Leader" for such a long period?
If I change the object name in one action will it be updated in all the actions? Or not?