Hi,

Pl find the solutions...most probably I m correct

1. rw=Browser(XX).Page(XX).WebTable(XX).GetRowCount
cl=Browser(XX).Page(XX).WebTable(XX).GetColumnCount
For i=1 to rw
   For j=1 to cl
      data=Browser(XX).Page(XX).WebTable(XX).GetCellData(i,j)
      If data="xyz" Then
        counter=counter+1
      End If
   Next
Next
msgbox counter

2. Write DP for it
Set obj=Description.Create
obj("micclass").value="WebElement"
cnt=Browser(XX).Page(XX).ChildObjects(obj).count
For each a in cnt
   msgbox  a.GetROproperty("innertext")
Next


3. For this write FSO object
Set fso=createobject("Scripting.FileSystemObject")
fso.open "path of notepad", 1
sData=fso.ReadAll
a=Split(sData," ",-1)
For i=0 to a.count-1
  If a(i)="computer"
     counter=counter+1
  End If
Next
msgbox counter


4. You r right

5. You can use the same code of 2


Hope, These solutions will solve your purpose


-Gopinath





On Thu, Jun 30, 2011 at 5:59 PM, gopi nath <[email protected]> wrote:

>
>
>  On Thu, Jun 30, 2011 at 1:34 PM, Charan <[email protected]> wrote:
>
>> Hello Experts !
>>
>> I have few interview qns in qtp  that are generally asked....and  want to
>> resolve them.  Please let me know if you know answer any of them :-
>>
>> 1. We have web table. In that some text suppose "xyz" is repeated in some
>> cells randomly. How will you count the number of times that that text
>> repeated in web table.
>>
>> 2. Suppose there are some elements in web page and index of the those
>> elements is changing randomly. How will you handle this situation. I mean
>> how to handle index of those elements.
>>   (we cannot use regular expression here)
>>
>> 3. In a flat file, suppose any string "computer" is repeated n number of
>> times. how to count that.
>>
>> 4. How to execute only one action in test script and not all actions that
>> are present. Is "Run Action ,Action name " will work for this.
>>
>> 5. If for an object, all the properties of that object are changing
>> randomly, then how the qtp will identify that object ? .
>>
>> Thanks
>> Charan
>>
>> --
>> 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

Reply via email to