Hi all,
Thanks for helping.
Things I tried are from the replies I got from you guys.
Worked code:
*Using 'Trim' for actual value works.*I have tried returning data type
yesterday itself and both were returning 'String' as type.
Since they are strings I didn't convert them again.
Code below:
x=
Browser("").Page("").Frame("").WebTable("").WebElement("").GetROProperty("innertext"
OR "outertext")
sActual=trim(x)
sExpected="xyz"
if(sActual=sExpected) then
msgbox "pass"
else
msgbox "fail"
end if
Thank you very much.
-Nimmi
On Mon, Nov 2, 2009 at 9:24 PM, abab zxzx <[email protected]> wrote:
> Dear ,
> First check the Type of variable it is returning
> then use Trim function to get rid of extra space
> then change it to string
> then compare
> it will work
>
> if still not working
> send me the url and desired object
> I will send u code for that
>
> Thanks and regards
> The Professional
>
>
> On Tue, Nov 3, 2009 at 5:49 AM, Nimmi <[email protected]> wrote:
>
>> Hi,
>> Am trying to get run time property "outertext" of a web element.
>> Am able to get the outertext.
>> I want to compare it with expected string, say "xyz".
>>
>> x=
>> Browser("").Page("").Frame("").WebTable("").WebElement("").GetROProperty("outertext")
>> msgbox x
>> If(x="xyz") then
>> msgbox "pass"
>> else
>> msgbox "fail"
>> end if
>>
>> Issue: Even though the expected result and actual result is matching,if
>> condition is returning a fail.
>>
>> I tried string comparison too.
>> When I do strcomp(x,"xyz",0) it returns boolean as true(as 1).
>> But when i use an if condition loop gives a fail message.
>> Am not sure where I am going wrong.
>>
>> Can you please help?
>> Also can you suggest how to use 'checkproperty' for a string after
>> applying GetROProperty?
>>
>>
>>
>>
>>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---