cancel
Showing results for 
Search instead for 
Did you mean: 

objects is different for a same static page but with different URL

SOLVED
Highlighted
Frequent Contributor

objects is different for a same static page but with different URL

www.webtesting.com/log-in and www. webtesting.com/log-out calls the same static page. but when we name map the objects it is creating 2 different objects for the smae username. how to handle this. 

 

aliases is mapped to browser. But the Mapped objects i see  parents are different. But when we automate in selenium we are able to use a single object for both url.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: objects is different for a same static page but with different URL

Page identification in name mapping, by default, when recording or manually mapping, uses the URL as one of the properties.  In order to "fix" this, you need to, after you do your intiai recording, edit the mapping of the page so that the URL is more generic.

 

For example, let's say you have two environments.

 

https://testenvironone.net/

https://testenvirontwo.net/

 

There is a static page for logging in with a path off the url of LoginPage

 

So, in a browser, you would see

 

https://testenvironone.net/LoginPage

 

or

 

https://testenvirontwo.net/LoginPage

 

When you record on the first environment, that full URL is include in the mapping of the page.  What you need to do is edit that mapping and replace the URL with

 

*/LoginPage

 

That will ensure that, no matter what environment you run under, the page will always be found.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

1 REPLY 1
Highlighted
Community Hero

Re: objects is different for a same static page but with different URL

Page identification in name mapping, by default, when recording or manually mapping, uses the URL as one of the properties.  In order to "fix" this, you need to, after you do your intiai recording, edit the mapping of the page so that the URL is more generic.

 

For example, let's say you have two environments.

 

https://testenvironone.net/

https://testenvirontwo.net/

 

There is a static page for logging in with a path off the url of LoginPage

 

So, in a browser, you would see

 

https://testenvironone.net/LoginPage

 

or

 

https://testenvirontwo.net/LoginPage

 

When you record on the first environment, that full URL is include in the mapping of the page.  What you need to do is edit that mapping and replace the URL with

 

*/LoginPage

 

That will ensure that, no matter what environment you run under, the page will always be found.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!
Top Kudoed Authors