Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help with script
#1
Not Solved
Hello Guys.

Please I made the following script but after checking syntax in QTP it showed me the errors but I can not sort them out. please could you help me?

Code:
If Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("DAACC3303A").Exist(2)
                                And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("Assigned").Exist(2)
                And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("Cisco - WS-C2960...").Exist(2)
                And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("Created on 04/24/2012").Exist(2)
                 And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").Link("BMW USA").Exist(2)
                 And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("Terremark Networ...").Exist(2)
                 And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("SWITCH48X48_2").Exist(2)
                 And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("Last Modified on 05/04/2012").Exist(2)

                Then
                a="Hello World"
                                                                MsgBox a
Else
                                                                b="Failure"

                                                                MsgBox b
End If




MsgBox a
Please I will appreciate any help.

Regards,
Reply
#2
Not Solved
Hi Jorge,

What error are you facing? Can you provide a screenshot of the error?

Thank You,
Ravi Shankar
Reply
#3
Not Solved
HI,

when ever we are continue our Line of Code in the next line then there should be a link (_) between the lines in order to consider it as a single statement.
Please find the below updated code.
Code:
If Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("DAACC3303A").Exist(2)_
And     Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("Assigned").Exist(2) _
And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("Cisco - WS-C2960...").Exist(2) _
And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("Created on 04/24/2012").Exist(2)_
And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").Link("BMW USA").Exist(2)_
And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("Terremark Networ...").Exist(2)_
And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("SWITCH48X48_2").Exist(2)_
And Browser("CMDB - InstanceMainDisplay").Page("CMDB - InstanceMainDisplay").WebElement("Last Modified on 05/04/2012").Exist(2) Then
a="Hello World"
MsgBox a
Else
b="Failure"

MsgBox b
End If




MsgBox a

Please let me know if you need any further information.
Thanks,
SUpputuri
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)