I think more than one objects are present, try index property once. & use
descriptive webElement property value(highlighted in red colour)
If
Browser("CreationTime:=0").Page("CreationTime:=0").WebElement("innertext:=File
Upload successfully","index:=0").Exist(0) Then
Msgbox "Success"
Else
Msgbox "Fail"
End If
On Saturday, April 4, 2015 at 4:27:24 PM UTC+5:30, vidya Bose wrote:
>
> Hi.... I have tried the below code as well... It always returns TRUE even
> if the webelement doesnt exists
>
>
> Result = Browser("....").Page("....").Webelement("File Uploaded
> successfully").Exist(0)
> msgbox Result
>
>
> On Friday, April 3, 2015 at 11:31:45 AM UTC-5, rajivkumarnandvani wrote:
>>
>> Firs you should validate is your script output is returning true or false
>> using this
>> Msgbox Browser("CDMS :: Master Agreement").Page("CDMS :: Master
>> Agreement").WebElement("File Upload successfully").Exist(0)
>>
>> Then store it's output in a variable
>> After that you can implement if else condition on this variable
>>
>> On Friday, April 3, 2015, vidya Bose <[email protected]> wrote:
>> > Hi, I am trying to validate if a webelement property exists on the page
>> or not. But QTP always returns true :( and not going to 'Else' part . Below
>> is my code. pls help to fix this :(
>> > ************************************************************
>> > BlnResult = Browser("CDMS :: Master Agreement").Page("CDMS :: Master
>> Agreement").WebElement("File Upload successfully").Exist(0) Then
>> > Msgbox "Success"
>> > Else
>> > Msgbox "Fail"
>> > End If
>> > ************************************************************
>> > QTP always returns "success" even in case if web element doesn't exist
>> on the page.
>> >
>> > --
>> > --
>> > You received this message because you are subscribed to the Google
>> > "QTP - HP Quick Test Professional - Automated Software Testing"
>> > group.
>> > To post to this group, send email to [email protected]
>> > To unsubscribe from this group, send email to
>> > [email protected]
>> > For more options, visit this group at
>> > http://groups.google.com/group/MercuryQTP?hl=en
>> >
>> > ---
>> > You received this message because you are subscribed to the Google
>> Groups "QTP - HP Quick Test Professional - Automated Software Testing"
>> group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to [email protected].
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>> --
>>
>> Regards
>>
>> *RAJIV <http://testeverythingrajiv.com/> KUMAR
>> <http://rajivkumarnandvani.wordpress.com/> NANDVANI
>> <http://testeverythingqtp.blogspot.com>*
>>
>> http://rajivkumarnandvani.wordpress.com
>> http://testeverythingqtp.blogspot.com/
>>
>>
>>
>>
>>
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.