Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if...then syntax frustration
#1
Solved: 10 Years, 9 Months, 1 Week ago
I'm using 9.5 on a pretty standard web application.
For some reason the following code is not working...

Code:
If (Browser("MyApp").Page("MyApp").Check CheckPoint("MyApp"))  Then
    Reporter.ReportEvent micPass, "Page_Load", "Success!"
End If


I get two syntax errors:

1) expected ")" [between the Check and the Checkpoint]
2) Expected end of statement

Please help!Sad
Reply
#2
Solved: 10 Years, 9 Months, 1 Week ago
I guess you missed one '(' , it should be


Code:
If (Browser("MyApp").Page("MyApp").Check (CheckPoint("MyApp"))
Reply
#3
Solved: 10 Years, 9 Months, 1 Week ago
you have missed '('
Code:
If (Browser("MyApp").Page("MyApp").Check CheckPoint("MyApp")))  Then
    Reporter.ReportEvent micPass, "Page_Load", "Success!"
End If

hope this would work fine for you!
Reply
#4
Solved: 10 Years, 9 Months, 1 Week ago
Hello,
Rachna in your solution I am getting following error.

'(' expected.

As I mentioned above you can use following code.

Code:
If Browser("MyApp").Page("MyApp").Check (CheckPoint("MyApp")) Then
Reporter.ReportEvent micPass, "Page_Load", "Success!"
End If
Reply
#5
Solved: 10 Years, 9 Months, 1 Week ago
Thank you SO much. I can't tell you how long I stared at that code. if it had been Visual Test, I would have nailed it right away. Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Correct syntax for read and load global datatable from Resources tab in QC to QTP hari1024 1 4,999 12-08-2011, 10:43 AM
Last Post: sshukla12
  Passing syntax check;but ignoring code cocojava 1 2,249 04-25-2011, 05:55 PM
Last Post: Saket
  How Can I use this Syntax? NancyNancy 2 5,278 02-24-2011, 10:54 PM
Last Post: NancyNancy
  Script gives syntax error in Flight reservation Application pnp19 8 8,915 11-19-2009, 10:03 AM
Last Post: Saket
  Function works fine in QTP but when i put it in vbs file it throws syntax error Rashmi 0 2,135 08-13-2008, 09:13 PM
Last Post: Rashmi

Forum Jump:


Users browsing this thread: 1 Guest(s)