11 years ago
Changing website urls for tests
I have a simple test build that goes to one of our websites and clicks a link. It works when I execute it on that website A - the website it was originally recorded on.
However, when I execute the same test on website B, which is an identical copy of website A with a different url - I get errors.
I'm using Keyword tests, and I have a variable defined for the value. When the variable's set to website A's url - it executes normally; on website B it generates errors.
The errors for each step are the same
'An error occurred while accessing the "XXX" method or property of the "XXX" object.
When I convert to script, I don't see anything hard-coded that looks like it would cause an error.
function Test10()
{
var StartUrl;
StartUrl = "http://XXX.website.com";
//Opens the specified URL in a running instance of the specified browser.
Browsers.Item(btIExplorer).Navigate(StartUrl);
//Waits until the browser loads the page and is ready to accept user input.
Aliases.browser.someMethod.Wait();
//Moves the mouse pointer over the 'linkHomeAspx' control.
Aliases.browser.someMethod.formAspnetform.panelSmoothmenuAjax.linkHomeAspx.HoverMouse(0, 0);
//Moves the mouse pointer over the 'panelLeftnavbrowseUpdatepanel1' control.
Aliases.browser.someMethod.formAspnetform.panelLeftnavbrowseUpdatepanel1.HoverMouse(187, 30);
//Clicks at point (3, 11) of the 'panelHitareaExpandableHitarea' object.
Aliases.browser.someMethod.formAspnetform.panelLeftnavbrowseUpdatepanel1.panelHitareaExpandableHitarea.Click(3, 11);
Aliases.browser.someMethod.Wait();
}
However, when I execute the same test on website B, which is an identical copy of website A with a different url - I get errors.
I'm using Keyword tests, and I have a variable defined for the value. When the variable's set to website A's url - it executes normally; on website B it generates errors.
The errors for each step are the same
'An error occurred while accessing the "XXX" method or property of the "XXX" object.
The object or one of its parent objects was not found.
Object Whose Method or Property Was Accessed'
When I convert to script, I don't see anything hard-coded that looks like it would cause an error.
function Test10()
{
var StartUrl;
StartUrl = "http://XXX.website.com";
//Opens the specified URL in a running instance of the specified browser.
Browsers.Item(btIExplorer).Navigate(StartUrl);
//Waits until the browser loads the page and is ready to accept user input.
Aliases.browser.someMethod.Wait();
//Moves the mouse pointer over the 'linkHomeAspx' control.
Aliases.browser.someMethod.formAspnetform.panelSmoothmenuAjax.linkHomeAspx.HoverMouse(0, 0);
//Moves the mouse pointer over the 'panelLeftnavbrowseUpdatepanel1' control.
Aliases.browser.someMethod.formAspnetform.panelLeftnavbrowseUpdatepanel1.HoverMouse(187, 30);
//Clicks at point (3, 11) of the 'panelHitareaExpandableHitarea' object.
Aliases.browser.someMethod.formAspnetform.panelLeftnavbrowseUpdatepanel1.panelHitareaExpandableHitarea.Click(3, 11);
Aliases.browser.someMethod.Wait();
}