SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Doubts on DP approach

    Need some clarification on Descriptive programming :

    "When you want to take action on similar type of object i.e. suppose we have 20 textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now adding all 20 the Object repository would not be a good programming approach."

    Now my Query is that : can't we add one object of this type in OR and use regular expression in name property like txt.* and then perform operations like childobjects()

  2. #2
    Member
    Join Date
    May 2009
    Posts
    162
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Doubts on DP approach

    I think you are on right track. You may not even want to add text box to OR.
    <font class="small">Code:</font><hr /><pre>
    for i = 0 to 20
    Browser("").Page("").WebEdit("name:=txt_" &amp; i).Set "SomeText"
    next i
    </pre><hr />

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Doubts on DP approach

    But how to get to know that how many object of that type for e.g text boxes are available on the web page ? We might not be knowing that in advance.

  4. #4
    Senior Member
    Join Date
    Sep 2007
    Posts
    114
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Doubts on DP approach

    Take a count of the number of child objects of type ,say text boxes of the parent object.
    -Soumya

  5. #5
    Member
    Join Date
    May 2009
    Posts
    162
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Doubts on DP approach

    Code sample below:

    <font class="small">Code:</font><hr /><pre>
    SystemUtil.Run "https://accounts.google.com/SignUp?continue=http%3A%2F%2Fwww.google.co.in%2F&a mp;hl=en"

    Set oDesc = Description.Create
    oDesc("html tag").value = "input"
    oDesc("type").value = "text"
    'oDesc( "name").value=".*" 'All text boxes
    oDesc( "name").value="Birth.*" ' all text boxes starting wtih Birth, in the given page it is 2
    oDesc( "name").regularExpression = True

    Set oCollElements = Browser("title:=Google Accounts").Page("title:=Google Accounts").ChildObjects(oDesc)

    For i = 0 to oCollElements.Count - 1
    Print oCollElements(i).GetROProperty("name")
    Next

    </pre><hr />

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:05 PM.

Copyright BetaSoft Inc.