Forum Discussion

markbain's avatar
markbain
Occasional Contributor
15 years ago

Web Nav Bars and Name Mapping

The website I am testing has a 'header' section that is used as a Navigation throughout the site.  However, when I record scripts and click on tabs, the objects get stored under the specific page they were recorded in.



EG: Nav Bar: 'Home | Search | Admin'



If I clicked on 'Search' when on the 'Home' page, then the 'Search' nav object gets stored in the 'Home' page tree.  If I want to use that same object from the 'Admin' page, I have to record/capture that object while on the 'Admin' page.  Thus having duplicate objects within the Name Mapping (one under the Home tree and one under the Admin tree).



Is there an easier way to get these types of objects available throughout the website without having it specifically tied to the page you originally recorded it from.

1 Reply

  • Mark,



    As i described in the post as response to another question of yours, Its once again a case of playing with the properties of a generic object.




    Say you have pages - Pg1 Pg2 Pg3 and you have Tb1 Tb2 Tb3 as the links to browse through in each of those pages.




    now map any of the pages Pg1 Pg2 Pg3 and select some common properties from all the 3 pages and map an object PgGeneric

    in the PgGeneric map for any of Tb1 Tb2 Tb3  as TbGeneric and choose the properties caption and class to map the object and for the caption property value point it to some project variable.




    Once thats done all you would need to do on any page to click any tab is.




    Project.Variables.Caption = Tb1

    Aliases. PgGeneric.TbGeneric.RefreshMappingInfo ' Not really necessary but just for the sake of reassurance


    Aliases. PgGeneric.TbGeneric.Click




    And the click is done at the right spot.





    similarly if you want to click Tb2





    Project.Variables.Caption = Tb2

    Aliases. PgGeneric.TbGeneric.Click





    And the click is done at the right spot.




    Thankyou