SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Mar 2004
    Location
    Folsom, California
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Dynamically Identifying Objects/ Programmatic Description

    Here is some information about my application.

    There are 5 text boxes(rows) and I want to enter some values into them. I have recognized one text box in the repository. For the rest of them I want to bypass the repository and input the values directly by writing code. Here is the my code

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
    Set WebOrderQty = Description.Create()
    WebOrderQty(&quot;html tag&quot.Value = &quot;INPUT&quot;
    WebOrderQty(&quot;name&quot.Value = &quot;ORD_LINE_QTY_ORDERED$2&quot;
    WebOrderQty(&quot;type&quot.Value = &quot;text&quot;
    WebOrderQty(&quot;class&quot.Value = &quot;PSEDITBOX&quot;
    If Browser(&quot;Create/Update&quot.Page(&quot;Create/Update&quot.Frame(&quot;TargetContent&quot.WebEdit(WebOrderQty).Set &quot;10&quot;
    </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Or can also do like

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> Browser(&quot;Create/Update&quot.Page(&quot;Create/Update&quot.Frame(&quot;TargetContent&quot.WebEdit(&quot;class:=PSEDITBOX&quot;,&quot;name:= ORD_LINE_QTY_ORDERED$0&quot;,&quot;type:=text&quot ;,&quot;html tag:=INPUT&quot.Set &quot;10.00&quot;
    </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Its giving an Error stating cannot identify the object "WebEdit"(of class WebEdit). Verify that this object's properties match an object currently displayed..."

    Not sure if I am making some mistake. Any hints or suggestion is appreciated. BTW I am new to QTP have worked with Winrunner previously.

    Thanks
    - Saumitra

  2. #2
    Member
    Join Date
    Nov 2004
    Posts
    69
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamically Identifying Objects/ Programmatic Description

    Hi
    Use Descriptive programming . first record parent level object in QTP-OR. like in u r case use
    Browser("Create/Update").Page("Create/Update").Frame("TargetContent").WebEdit("class:=PS EDITBOX","innertext:"=& text_box name & ","type:=text","html tag:=INPUT").Set "10.00"
    Pass the text box name from a constant variable.What u have done is right but use innertext : insted of name.

  3. #3
    Member
    Join Date
    Mar 2004
    Location
    Folsom, California
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamically Identifying Objects/ Programmatic Description

    Hi Ba,

    It still doesn't recognize the webedit box. The innertext is not one of the properties that is either recognized by Object Spy or through the GetToProperty method.

    Thanks
    - Saumitra

  4. #4
    Senior Member
    Join Date
    Jan 2000
    Location
    USA, CA
    Posts
    1,998
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamically Identifying Objects/ Programmatic Description

    Try GetROProperty("innerText").
    Sometimes, TOProperty is not always captured
    by QTP in RunTime.
    Check this value with msgBox, to know for sure
    if QTP can see it.

  5. #5
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamically Identifying Objects/ Programmatic Description

    Try this:

    Browser("micClass:=Browser").Page("micClass:=Page" ).Frame("micClass:=Frame").WebEdit("name:=ORD_LINE _QTY_ORDERED.*","index:=0").Set "10.00"

    I always use name for a WebEdit box, innerText is not gauenteed to be useable.

    Mark Smith.

 

 

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 04:16 PM.

Copyright BetaSoft Inc.