cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
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
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
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
Top Kudoed Authors