Micro Focus QTP (UFT) Forums
Problem in identifying webbutton - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Problem in identifying webbutton (/Thread-Problem-in-identifying-webbutton)



Problem in identifying webbutton - vijay44 - 02-08-2010

Hi,
I have a problem in identifying the webbutton.

The only property that a webbutton differs from the other is outerhtml.
The outhtml of webbutton is:<INPUT onclick=doCopy(1) type=button value=c name=method>
I dont want to click the first webbutton, i want to click the other webbuttons
Iam using the following code

Code:
Set WbEdit = Description.Create()
WbEdit("micclass").Value = "WebButton"
WbEdit("name").Value = "C"
Set AllWbEdit = Browser("micclass:=browser").Page[/b]("micclass:=Page").ChildObjects(WbEdit)
        NumberOfEdits=AllWbEdit.Count
        msgbox NumberOfEdits
        For i=0 to(NumberOfEdits)-1
          if AllWbEdit(i).GetRoproperty("outerhtml")<>".*doCopy(0).*"  then
             AllWbEdit(i).Click
             End If
             Next
It does give the count, but it does not filter.probabily my representation of outerhtml is going wrong.
i tried with index, even the index is not working.
i want to exactly represent the outerhtml, this may solve my problem.
Any help will be really appreciated.
Regards;
Vijay


RE: Problem in identifying webbutton - satan - 02-08-2010

See if this works:

in if condition place this
Code:
AllWbEdit(i).GetRoproperty("outerhtml")<>".*doCopy\(0\).*"