Results 1 to 7 of 7
  1. #1

    query about innertext

    in my case i have different scenarios which give result like "4,000" or "5,000" etc etc. when i add resultant object in object repo it add only innertext property which shows "4,000" and html id is blank. and after that when i execute any other scenario which return result except then "4,000" it always give message object not found.

    My question is either i have to add all resultant object or by adding just one object i can access other results?

    Hope my question is clear enough.

    Life is the Game of Luck

  2. #2

    Re: query about innertext

    If InnerText is dynamic, do not use it as Object Identifier. Just delete it from OR. Use another properties of Object.
    And turn off Smart Identification.


  3. #3

    Re: query about innertext

    thanks janna.. but the thing is then which property i should use as identifier as it have no html id.

    Life is the Game of Luck

  4. #4

    Re: query about innertext

    What Object you are working on?
    If it is only one on the page: use generic properties.
    If not: explore Object with Object Spy and try to figure out what can you use.
    As last resort - use Index.


  5. #5

    Re: query about innertext

    Apologies for steering slightly off-topic, but how often could the Index change on a web object?


  6. #6
    Advanced Member
    Join Date
    Mar 2007
    Salt Lake City, UT, USA

    Re: query about innertext

    You could also make the innertext property a regular expression in the OR.

    Your Regex might look like this:

    Of course, this will only work if there are no other objects of the same class with a numerical innertext that fits the pattern. With such a short innertext, that can be risky.

    You might also consider going to innerhtml or outerhtml, changing that to a regex, and then replacing the 4,000 (which will be found somewhere in that long html code) with the regex I suggested. This might be a little less risky than using the regex on the innertext.
    "The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"

  7. #7

    Re: query about innertext

    >how often could the Index change on a web object?
    It depends...
    If page changed and similar object has being added before object you've identified with Index - Index will be changed. Developers do not have control on Index property and do not code it. It is Browser rangers all objects according its location on the page.

    If object has being added after Indexed one (I mean: its location on the page) - it will not effect on TestCase object Indexing.

    Once, I have huge problem with WebTable, that could not be identified in other way, then with its Index. Location seemed to be quite stable and TCs work properly one year or so. Then, boom... Design was changed. 200 TCs were crashed. I had to open each one and change Index. The guy, who code it, promised: "no changes any more..."
    I've left it and did not find other solution. In about year was next "boom...". And I had to do "monkey" business twice...
    It was too much...
    I've found solution for that:
    Index of this WebTable was written in my configuration file and each TC reads the value of it from that .ini file and finds WebTable accordingly.
    Solution comes just in time... Changes were done in design in couple of month... But this time - I just go into configuration and change that Index for this build (release). I've preserved previous Indexing also, because we are running 2-3 releases down and next ahead.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:46 PM.

Copyright BetaSoft Inc.