Thanks guys. Thank's for the good responses.
I have fixed this in a different way as follows [may be inefficient way, but
this works ;-)]:
AppActionList = Browser("title:=Add Action Code").Page("title:=Add Action
Code").WebList("name:=appActionCode").GetROProperty("innerhtml")
'Split the above string based on the delimiter specified
arr = Split (AppActionList, "OPTION value=",-1,1)
'calculate the upper dimension for the array
x = UBOUND(arr)
'Preserve the dynamic array's dimension
ReDim Preserve collArray(x)
'Loop through and find the list box values dynamically
For i=1 to UBOUND(arr)
firstPOS = InStr(arr(i), ">")
secondPOS = InStr(arr(i), "<")
stringLenghtToReturn = (secondPOS - firstPOS)
str = mid(arr(i),firstPOS+1,stringLenghtToReturn-1)
collArray(i) = str
Next
'Code to compare the expected value and actual value goes here.
Regards,
Karthik
On 4 May 2011 04:30, Suresh Bhandari (Mahindra Satyam) <
[email protected]> wrote:
> U can use Microsoft.XMLDOM object to handel XML operations.
>
> Check below example
>
> Set xmlDoc = CreateObject("Microsoft.XMLDOM")
>
> xmlDoc.Async = False
>
> xmlDoc.Load(XMLDataFile) 'XMLDataFile ur xml file path
>
> Set nodes = xmlDoc.SelectNodes("/option()")
>
> ' get node values
>
>
> 'to print all values from option
>
> For i = 0 To (nodes.Length - 1)
>
> Value = nodes(i).NodeValue
>
> MsgBox Value
>
> Next
>
>
>
>
>
> On Tue, May 3, 2011 at 1:52 PM, Karthikeyan <
> [email protected]> wrote:
>
>> Hi all,
>>
>> I have a requirement as below.
>>
>> I get a dynamic string as follows:
>> <OPTION value=""></OPTION> <OPTION value=DENYALL>Deny All</OPTION><OPTION
>> value=DENYENTRY>Deny Entry</OPTION><OPTION value=DENYEXIT>Deny
>> Exit</OPTION><OPTION value=UNRESTRICT selected>Unrestricted</OPTION>
>>
>> My requirement is: to read all the "value" attributes in the above string.
>> Is there a simple way to do that. Is it possible to save this string as an
>> XML and read the attributes for each "OPTION" node?
>>
>> Please suggest/guide me few solutions.
>>
>> Regards,
>> Karthikeyan
>>
>> --
>> 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
> "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
"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