Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

18120 Posts in 4741 Topics- by 31743 Members - Latest Member: suuraj
 

Pages: [1]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: Problem in identifying the webbutton    (Read 124 times)
vijay44
User
*
Offline Offline

Posts: 18


« on: February 08, 2010, 12:51:50 AM »

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

 Set WbEdit = Description.Create()
      WbEdit("micclass").Value = "WebButton"
      WbEdit("name").Value = "C"
'      wbEdit("index").Value=1
      Set AllWbEdit = Browser("micclass:=browser").Page("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
Logged
Robinhang
User
*
Offline Offline

Posts: 2


« Reply #1 on: February 08, 2010, 01:26:34 AM »

It's really a problem that it cannot identify the web button.
And will you provide more info of the problem?
Logged
Alexey Rakitsky
User
*
Offline Offline

Posts: 40


« Reply #2 on: February 08, 2010, 01:31:29 AM »

I'm not sure this statement is correct:

     if AllWbEdit(i).GetRoproperty("outerhtml")<>".*doCopy(0).*"  then

You should use specially object to compare string against regular expression
Logged

Best Regards,
Alexey
Asiq Ahamed
Moderator
Sr. User
*****
Offline Offline

Posts: 459



WWW
« Reply #3 on: February 08, 2010, 02:38:38 AM »

Hi Vijay,
      Could you try this way?
Code
GeSHi (qtp):
Set WbEdit = Description.Create()

WbEdit("micclass").Value = "WebButton"

WbEdit("name").Value = "C"

Set AllWbEdit = Browser("micclass:=browser").Page("micclass:=Page").ChildObjects(WbEdit)

NumberOfEdits=AllWbEdit.Count

msgbox NumberOfEdits



For i=0 to(NumberOfEdits)-1



if Mid(AllWbEdit(i).GetRoproperty("outerhtml"),17,9)<>"doCopy(0)"  then

AllWbEdit(i).Click

End If



Next

 
Created by GeSHI 1.0.7.20
Logged
Pages: [1]   Go Up
Print
Jump to: