SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Junior Member
    Join Date
    Nov 2006
    Location
    Singapore
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Dynamic changes in Web Element innertext value

    Hi,

    I have a issue with dynamic changes in Web Element innertext in my web application.

    Application having different Frames, each frame consists of no. of web element objects, which values will change dynamically based on transactions. Here my problem is not able to capture dynamic changes of web Element object value.

    For Ex: Browser("X").Page("Y").Frame("Amountslip").WebElem ent("9.24").GetROProperty("innertext"), here Web Element innertext value will change every time.
    How to capture change in value of Web element every time

    I would be glad if some one can suggest me in this regard

    Thanks & Regards
    Srinivas

  2. #2
    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: Dynamic changes in Web Element innertext value

    After recording, check Repository: what properties are used to recognize this object. Be sure, that you don't use innertext, because next time, when it's changed QTP will not define it and give the Error - Object doesn't exist.

    To capture this property in the code:
    sText = Browser("X").Page("Y").Frame("Amountslip").WebElem ent("9.24").GetROProperty("innertext")

    Janna

  3. #3
    Junior Member
    Join Date
    Nov 2006
    Location
    Singapore
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamic changes in Web Element innertext value

    Thanks for your prompt reply.

    It was not recognizing while in record, hence i explicitly add those objects(Web Element) into OR, and verified those property values. All the web element objects having innertext values, hence storing the value in a variable like sText = Browser("X").Page("Y").Frame("Amountslip").WebElem ent("9.24").GetROProperty("innertext").
    For first time it is working, since web element values are same, but from the second time onwards web element inner text values changing, hence giving error message like "Object not found".

    I have tried using Output Value option, but vain.

    Please suggest me how exactly will handle value changes in Web element object.

    Thanks & Regards
    Srinivas

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Dynamic changes in Web Element innertext value

    Ok, typical dynamic value case. When you add the object manually to the OR, do you see a parent object as a WebTable? if yes then your job becomes very easy. You can add the webtable to the OR and then use GetCellData to get the value but if that is not the case then you need to look at some mechanism to recognize the webelement which might not be that easy...

  5. #5
    Junior Member
    Join Date
    Nov 2006
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamic changes in Web Element innertext value

    Dear Friend,

    Check in the OR what are the Manadatory properties checked to recognize this object. if there is any property having constant "9.24" as its value then uncheck the property and try adding a unique property like "html id" or that which is unique i.e. which does not change during the runtime.

    After doing the above try sText = Browser("X").Page("Y").Frame("Amountslip").WebElem ent("9.24").GetROProperty("innertext") you will get the value.


    Akilesh

  6. #6
    Junior Member
    Join Date
    Nov 2006
    Location
    Singapore
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamic changes in Web Element innertext value

    Very glad to see both of your replies

    Tarun: As it is not considering as Web Table for parent Object, despite when i tried spying the main Frame, shown as Web Table and more over its innertext property value taking as all web elements details, which are there in that frame.
    When i wrote this piece of code, saying unknown object though it is in OR
    s = Browser("X").Page("Y").Frame("betslip").WebTable(" WebTable_2").GetCellData(1,0)
    s1 = Browser("X").Page("Y").Frame("betslip").WebTable(" WebTable_2").GetCellData(0,2)
    msgbox s & s1

    Akilesh:
    I tried as per your suggetion, like adding Html ID as 1, 2, 3, etc for each Web Element, though it couldn't work.
    Even this time tried impleting Output value, like
    Browser("X").Page("Y").Frame("betslip_2").Check CheckPoint("betslip_9"), in this case it is working for only one webelement value rather than all web elements, since i have implemented Output values to all web elements.

    It would be great, if any of you could share your perceptions

    Thanks & regards
    Srinivas

  7. #7
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Dynamic changes in Web Element innertext value

    Can you attach the HTML of the webpage to the post...

  8. #8
    Junior Member
    Join Date
    Nov 2006
    Location
    Singapore
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamic changes in Web Element innertext value

    Hi Tarun,

    Pls find attached screen shot and HTML code for your reference. In screen shot rounded of web elements which i need to capture those dynamic values.

    Thanks & Regards
    Srinivas
    Attached Files Attached Files

  9. #9
    Apprentice
    Join Date
    Dec 2004
    Location
    Ind
    Posts
    49
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dynamic changes in Web Element innertext value

    Hi,

    I think you can use the following properties in OR for this WebElement
    html tag
    abs_x
    abs_y

    Then the following line of code should give you the text
    sText = Browser("X").Page("Y").Frame("Amountslip").WebElem ent("9.24").GetROProperty("innertext")

  10. #10
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Dynamic changes in Web Element innertext value

    For the information on top if you see the source code then it has

    <font class="small">Code:</font><hr /><pre>
    &lt;TABLE id=infoBar height=10 width="100%" border=0&gt;&lt;TBODY&gt;

    so you can use
    B().P().WebTable("html id:=infoBar").GetCellData (row,col) '2,1 will give u the eposure amount.

    Similarly is the next table
    &lt;TABLE class=offerTable id=EditSelections_tblEditSelections style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-COLLAPSE: collapse; BORDER-RIGHT-WIDTH: 0px" cellSpacing=0 cellPadding=0 border=0&gt;&lt;TBODY&gt;

    B().P().WebTable("html id:=EditSelections_tblEditSelections").GetCellData (row,col)
    </pre><hr />

 

 
Page 1 of 2 12 LastLast

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 9.68%
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 12:46 AM.

Copyright BetaSoft Inc.