Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unable to get the webbuttons count(child objects)
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi guys,

In my application in side the frame few buttons are available like add, delete, filter...

I could recognize the frame by using index number. now i want to count the no.of buttons in the frame(it is grid)

Here I can able to click the single button individually with name property.
I f i follow this i have to write function for each button individually. I do not want this.

If i have buttons count based on that count i will click on particular button.

I tried with the following code but i'm getting the type mismatch error.


Code:
Set WebBrowserDesc=Description.Create
                            WebBrowserDesc("application version").value="internet explorer 8"
                            WebBrowserDesc("title").value="http://172.16.220.24/Proof/PageManager.aspx"
                            
                            Set WebPageDesc=Description.Create
                            WebPageDesc("url").value="http://172.16.220.24/Proof/PageManager.aspx"

Set WebFrameDesc=Description.Create
                            WebFrameDesc("html tag").value="IFRAME"
                            'WebFrameDesc("title").value="PROOF - ISpace"
                            WebFrameDesc("Index").value="5"

Set WeButtonDesc=Description.Create
                             WeButtonDesc("type").value="submit"
                             WeButtonDesc("html tag").value="INPUT"
                             'WeButtonDesc("name").value="Add"
                               WeButtonDesc("micclass").value="WebButton"

                                Set objwebbutton=Browser(WebBrowserDesc).Page(WebPageDesc).Frame(WebFrameDesc).ChildObjects(WebButtonDesc)                    
                                msgbox objwebbutton.Count

please find the attachement for error.

any one knows the solution.
pls providethe solution ASAP.

Thanks in Advance!


Attached Files Image(s)
   
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Try the below

Code:
Set objBrowser=Description.Create
objBrowser("title").value=".*"

Set objPage=Description.Create
objPage("title").value=".*"

Set objButton=Description.Create
objButton("type").value="submit"
objButton("html tag").value="INPUT"
objButton("name").value="Add"

Set objChildObjects=Browser(objBrowser).Page(objPage).Childobjects(objButton)
msgbox objChildObjects.count

'Release the objects once operation is over
Set objBrowser=Nothing
Set objPage=Nothing
Set objButton=Nothing
Set objChildObjects=Nothing


Regards,
Ankesh

Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
It is working fine now without doing any changes.


Thanks for your solution.
without doing any changes in my script it is working fine.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Child Object Not able to identified in Web Menu Link noor 0 1,886 01-21-2018, 04:44 PM
Last Post: noor
  Using static descriptive programming how to count no. of objects on any webpage alpha1 4 7,093 08-11-2015, 08:48 PM
Last Post: kotaramamohana
  Selecting child node from Wintree object ajith123 2 5,358 02-26-2014, 02:12 AM
Last Post: supputuri
  Child Objects in JavaWindow shubham 0 2,978 01-24-2014, 03:21 AM
Last Post: shubham
  Unable to select an item from weblist and unable to enter text in edit box estherindu 5 9,710 05-15-2012, 12:07 AM
Last Post: viswa

Forum Jump:


Users browsing this thread: 1 Guest(s)