hi,
    there are many ways to split and get second string easily,
1. you can use split function with separator as (,)
        string1="Apple"
       string2=browser("").page("").webedit("").getroproperty("value")
        Str=split(string2,",")
         if strcomp(string1,Str(0))=0 then
         it will returns Str(0)="Apple"
                             Str(1)= "Orange"
             else
                   msgbox "string doesn't match"
         end if
2. you can count the length of first string which are given before button
click, after than you can get string at run time matched with previous
string.
              lenSr1=len(string1)
              / return to you 5
             lenStr2=len(string2)  /which was fetch at run time
              Str=mid(string2,lenSr1+1,lenStr2)
              this will return to you "Orange"


Thanks...
Akhalesh


On Tue, May 21, 2013 at 4:24 PM, Rajesh <[email protected]> wrote:

> I tried it but how will you get the difference after fetching the text
> using this method ? Let's say Initially the text box displayed "Apple".
> Once the user clicks a button, the text changes to "Apple, Orange". Now I
> need a way to find the text "Orange" alone.
>
>
>
> When I use GetROProperty method, I get "Apple, Orange". The previous text
> is "Apple". If I make this as Str1 and "Apple,Orange" as Str2, I need some
> way to find S2-S1 which will give me "Orange" as the result.
>
> On Tuesday, May 21, 2013 3:49:19 PM UTC+5:30, swapnil algamwar wrote:
>
>> Read that second string at runtime and assign it to the variable and then
>> comapre  this string and the variable string.
>>
>>
>> On Tue, May 21, 2013 at 3:00 PM, Rajesh <[email protected]> wrote:
>>
>>> Hi, I need a way to find the difference between two strings in VBScript?
>>> One of the strings is known but the second one is completely unknown during
>>> coding. I know there are functions like StrCompare, InStr etc. but these
>>> require you to know the second string also during coding.
>>>
>>> Let me explain: There is a text box in the screen and there are several
>>> buttons in the same screen. As and when the buttons are clicked, the text
>>> in the text box changes depending on the button clicked. Is there a way to
>>> find the changes made to the text after the button is clicked ? Is there a
>>> simple way to do this or it requires complex coding ?
>>>
>>> Thanks in Advance.
>>>
>>> --
>>> --
>>> 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
>>> MercuryQTP+...@**googlegroups.com
>>>
>>> For more options, visit this group at
>>> http://groups.google.com/**group/MercuryQTP?hl=en<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 mercuryqtp+...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> Thanks and Regards:
>> Swapnil S. Algamwar
>>
>  --
> --
> 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/groups/opt_out.
>
>
>



-- 
Akhalesh yadav
+919555717928
+919310680659

-- 
-- 
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/groups/opt_out.


Reply via email to