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 will you enchance the script?

1 Answers  


During test run,How will you copy/paste from/to clipboard?

3 Answers  


I'm facing this problem while automating my application..its a web based apps.. In my application there are few webtables are displaying in the page.In the different cells there are links and action buttons.Problem is there is link in different web tables corresponding to one name.Hence the properties of the objects(say a link) are same except the x,y co ordinate of the object.So my script is not able to distinguish between the two links present in different cells of web tables with same name.Kindly help on this..

3 Answers  


Why you have to add the specific add in in QTP? My answer is to recognize the specific objects we have to add the add-in in QTP...but he asked again after adding addin how qtp recognize the objects successfully? what is there in the add-in ?

1 Answers   CTS,


how do we add a new sheet to data table in QTP?

7 Answers   TCS, Wipro,






Is it possible to split an action? How?

0 Answers  


i have doubt suppose iam purly working in manual, when i will get work to do on sql and performence testing? pls any one clarify doubt?

0 Answers  


Can anyone share/send me QTP 8.2 Crack as I had it before but now it's virus affected. Pls send me on Sawale.vijay@gmail.com Thanks, ~Vijay

0 Answers   Zensar,


I have some real time based question.. 1.what are the challenges you have faced in your current project. 2.what are the bugs you found in your current project. 3.what are the strategies you follow to convert manual test cases into automation test cases. 4.how QTP identify two different browsers. 5. When you create a function library and share object repository what are the problems you have faced 6. How to solve the tool tip problem 7.what are the interesting bug you have found in your current project. 8.what is your daily work as a automation test engg. 9. how to create a weekly status report. 10. how many test cases you write,review and execute per day. 11.what are the uses of SQL in automation. 12.How to retrieve the data in html through vb script. 13.If application is very slow how to test the application in qtp.

0 Answers   Cap Gemini, TCS,


How exactly you start scripting in QTP? In the interview he was not satisfied with my answer.Please post what is correct answer.

2 Answers  


Hi Friends, Can any one answer this question? 17) What method is used to retrieve the number of columns in the query results? A. Fields.Count B. Fields.Item(EOF) C. Fields.Count(BOF) D. Fields.Count.Value

2 Answers  


What is object state in trigger events,in recovery scenario.write a script to handle this.

0 Answers  


Categories