Forum Discussion

saranoor's avatar
saranoor
Frequent Contributor
6 years ago

CLICKING ON A HYPERLINK WHICH IS NUMBER IN THE TOTAL COLUMN, NUMBER KEEPS GETTING UPDATED EVERY TIME

CLICKING ON A HYPERLINK WHICH IS NUMBER IN THE TOTAL COLUMN. NUMBER KEEPS GETTING UPDATED EVERY TIME A REPORT IS GENERATED.

I need to click on this link to move to next page.

 

So in one session the link may be a 21 and next session the link may be 50 as many users are generating reports.

It may remain teh same too if noone has generated a report.

 

How do we handle this scenario.

Test Complete records it as 

Aliases.browser.pageFred01.table.cell.table.cell5.link399

 

The 399 is ahyperlink in a total column which is changing.

  • I'd go with #3 then.  Just delete all other properties from the NameMapping for the object and just use the "Link" property.  It's the only link there and you already have the cell mapped... nothing else needed.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    That's a prime example of "dynamic properties".  I'm guessing you're using the number, somehow, in the property of the link that you need to click on.

     

    Rather than using that number, try replacing it in your name mapping with an asterisk (*) character in the property itself.  Or, perhaps see if there are other properties you can use to map the object that do not include the number.  

    • saranoor's avatar
      saranoor
      Frequent Contributor

      Added a screenshot of the property added in name mapping.

      1.Link

      2.<a href="index.cfm?fuseaction=MEDFR.EngineerList&amp;cdate=ALL&amp;stid=1&amp;apid=2">398</a>

      3. Sys.Browser("iexplore").Page("http://fred01/index.cfm?fuseaction=Navigation.Home&CFID=360414&CFTOKEN=1756a39ef7aad8ec-1A0EB420-C297-FF45-78FAD9E31D15911C").Table(1).Cell(3, 0).Table(0).Cell(131, 3).Link(0)

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Remove the "FullName" property from your mapping.  That's unnecessary, redundant, and, in fact, bypasses the benefits of the NameMapping engine entirely.

         

        I would go one of three ways with this.

         

        1) Replace the "398" in your outerHTML property with an asterisk (*) as that is the dynamic part of the link.  That's changing from run to run so if you replace with an asterisk, it will find any objects that match the whole string with that segment being variable. 

        2) If you can guarantee that you're running just internet explorer and only that browser, you can use the "href" property which will map with the string for the href as shown in the OuterHTML.  This is, I'm assuming, unique in the cell in question

        3) In that cell, if there are no other links in the cell... then just using the ObjectType property is all you need and remove the rest.  It's the only link, so it will match the object with the simplest set of object properties.