Results 1 to 10 of 10

Thread: Webtable object identification on webpage

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Answers
    23

    Unhappy Webtable object identification on webpage

    Hi all ,
    I am working on a web application. Where on every page some webtables are used. Currently I'm identifying them using following properties:
    1: Mandatory Props :
    a> html tag
    2: Assistive Props :
    None
    3: Smart Identification "On"
    4: Ordinal Identifier :
    a> Index

    But my problem is that the webtables in our application continues to change this "Index" property , as per application's requirement. What will be a useful way to uniquely identifying "webtable" control????


  2. #2
    Contributing Member
    Join Date
    Oct 2007
    Answers
    30

    Re: Webtable object identification on webpage

    Try using text property with regular expressions as it would be sometimes very large


  3. #3
    Contributing Member
    Join Date
    Nov 2007
    Answers
    48

    Re: Webtable object identification on webpage

    Hi,

    you can use ordinal identifier in order to recognize web table as a unique object in you application.

    What is Ordinal Identifier?
    The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables QuickTest to create a unique description when the mandatory and assistive properties are not sufficient to do so.

    Use Tools --> Object Identification to define ordinal Identifer.

    Cheers

    CPS


  4. #4
    Moderator
    Join Date
    Oct 2007
    Answers
    278

    Re: Webtable object identification on webpage

    Index is one of the Ordinal Identifiers, besides Location.

    Please clarify more upon the application and how WebTables are treated. Is the location of WebTables changing after every successive build? Are more rows/cols being added etc.?


  5. #5
    Junior Member
    Join Date
    Nov 2007
    Answers
    23

    Angry Re: Webtable object identification on webpage

    Hi Anshoo ,
    In our application , Index of the webtable is completely based on choices made from the filter screen. Means according to the filter choices the , after clicking "Submit" button , the webtables are made visible / invisible & that's why their Index property changes , as well as "Location" , the other ordinal identifier property , also gets changed. Another runtime property of webtable's object , that someone suggested to me was , "id". but again I'm getting balnk value for this property. So is there any unique property to identify webtables?


  6. #6
    Contributing Member
    Join Date
    Nov 2007
    Answers
    48

    Thumbs up Re: Webtable object identification on webpage

    I would simply suggest that first build your mandatory and assistive proerties set properly. Try to use more then property for mandatory and assistive properties. If this can not help then configure and use smart identification (smart identification is helpful when qtp is unable to identifiy an object or it match more then one object with the given description). In your case unique description is not being generated, so you can configure smart identification. If this solution still does not work then use index property of ordinal identifier. Moreover you can use regular expression to identify dynamically chagnging property values. You can also parameterize property values to handle dynamic objects. Cheers cps


  7. #7
    Moderator
    Join Date
    Oct 2007
    Answers
    278
    Count the number of WebTables every time on this particular page and use "If .. Then" statement to identify the WebTable at hand. Something like this:

    ' (Script) Count #s of WebTables
    ' If WebTables=Some_Number Then
    ' Do Action_1
    ' Else
    ' Do Action_2
    ' EndIf

    *I am not able to edit the post above, so need to make a new one*

    Could you please check if all the properties of the WebTables are the same? Check for properties like Innertext, name, etc. If even the innertext is different, we can make the script work for the WebTables. If not, you can count the number of WebTables, and depending upon the order, perform the necessary action on the WebTable that you want.

    Last edited by jainbrijesh; 12-29-2007 at 01:20 AM.

  8. #8
    Contributing Member
    Join Date
    Oct 2007
    Answers
    30

    Re: Webtable object identification on webpage

    My suggestion is after clicking "Submit" button once the next page opens with the tables try to retrieve all the webtables in the page e.g.

    Set objBrowserSync=Browser("SCC - Supply Chain Configurator_5").Page("SCC - Supply Chain Configurator")

    Set oDesc = Description.Create()

    oDesc("micclass").Value = "WebRadioGroup"

    Set Lists = objBrowserSync.ChildObjects(oDesc)

    NumberOfLists = Lists.Count()

    For i = 0 To NumberOfLists - 1

    msgbox Lists(i).getroproperty("name")

    Next

    Then u might be able to check whether a specific table exists I hope


  9. #9
    Moderator
    Join Date
    Oct 2007
    Answers
    278

    Re: Webtable object identification on webpage

    Here is a code to count all WebTables in a page:

    Set objValStore=Browser("micClass:=Browser").Page("micClass:=Page")
    Set objWebTableDesc=Description.Create()
    objWebTableDesc ("micclass").Value="WebTable"
    set WebTableParent=objValStore.Childobjects(objWebTableDesc)
    WebTableCount=WebTableParent.count
    msgbox WebTableCount

    Last edited by Anshoo_Arora; 12-29-2007 at 03:23 AM.

  10. #10
    Junior Member
    Join Date
    Nov 2008
    Answers
    1

    Re: Webtable object identification on webpage

    Quote Originally Posted by Anshoo_Arora View Post
    Count the number of WebTables every time on this particular page and use "If .. Then" statement to identify the WebTable at hand. Something like this:

    ' (Script) Count #s of WebTables
    ' If WebTables=Some_Number Then
    ' Do Action_1
    ' Else
    ' Do Action_2
    ' EndIf

    *I am not able to edit the post above, so need to make a new one*

    Could you please check if all the properties of the WebTables are the same? Check for properties like Innertext, name, etc. If even the innertext is different, we can make the script work for the WebTables. If not, you can count the number of WebTables, and depending upon the order, perform the necessary action on the WebTable that you want.
    Hi This is Gaurav,

    In my application WebTables index gets changes so frequently hence my script doesn't recognize those and I can't use Regular Expression since the same script I'm using on 7 languages and I don't find any property on which putting reg exp will be usefull even there is no other unique property to identify tables, please suggest me how can I overcome this issue..can't we overcome it by using advanced VB scripting, something like adding some properties explicitly to the web tables. Keeping count of all web tables on the page..will it help.., when there is addition of fw tables on the page and all the exising tables index gets increased respectively in that case this resolution is usefull..otherwise not ,..pls provide me the solution.


  11.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact