chicks
14 years agoRegular Contributor
click on link in sliding panel "misses"
I am attempting to test a login panel that appears on the webpage when you click the login button. The panel slides open.
I can find the close link, but when I click on it with the script, the panel does not close. When I click on it manually, the panel closes with no problem.
I notice that after the script completes but the panel does not close that the cursor is not centered on the close link, but instead it appears a little bit "off" to the right, and below it. I have tried adding a HoverMouse, but this makes no difference in the observed behavior.
Here's my code. Note that I am opening the webpage and panel manually. I believe this eliminates any possibility of a timing error.
function closeButton() {
currPage = Sys.Process("iexplore", iexploreNum).Page("*");
currPage.Wait();
var loginPanel = currPage.findChild(new Array("ObjectType","name"),new Array("Panel","*toppanel*"),9999);
verifyLinkExists(loginPanel,"Close");
var closeButton = loginPanel.findChild(new Array("ObjectType", "innerText"), new Array("Link", "Close"), 9999);
Log.Message(closeButton.Height);
Log.Message(closeButton.Width);
Log.Message(closeButton.ScreenLeft);
Log.Message(closeButton.ScreenTop);
closeButton.HoverMouse();
closeButton.Click();
}
function verifyLinkExists(aLocation, aLinkText) {
var link = aLocation.findChild(new Array("ObjectType","InnerText"),new Array("Link",aLinkText),9999);
if ( !link.Exists ) {
Log.Error("Link "+aLinkText+" was not found.");
}
else {
Log.Checkpoint("Link " + aLinkText + " found.")
}
}
I've attached two pictures of a closed and open login panel. I invoke closeButton() method with the panel open.
Thanks very much for any advice or suggestions.
Regards, Curt Hicks
I can find the close link, but when I click on it with the script, the panel does not close. When I click on it manually, the panel closes with no problem.
I notice that after the script completes but the panel does not close that the cursor is not centered on the close link, but instead it appears a little bit "off" to the right, and below it. I have tried adding a HoverMouse, but this makes no difference in the observed behavior.
Here's my code. Note that I am opening the webpage and panel manually. I believe this eliminates any possibility of a timing error.
function closeButton() {
currPage = Sys.Process("iexplore", iexploreNum).Page("*");
currPage.Wait();
var loginPanel = currPage.findChild(new Array("ObjectType","name"),new Array("Panel","*toppanel*"),9999);
verifyLinkExists(loginPanel,"Close");
var closeButton = loginPanel.findChild(new Array("ObjectType", "innerText"), new Array("Link", "Close"), 9999);
Log.Message(closeButton.Height);
Log.Message(closeButton.Width);
Log.Message(closeButton.ScreenLeft);
Log.Message(closeButton.ScreenTop);
closeButton.HoverMouse();
closeButton.Click();
}
function verifyLinkExists(aLocation, aLinkText) {
var link = aLocation.findChild(new Array("ObjectType","InnerText"),new Array("Link",aLinkText),9999);
if ( !link.Exists ) {
Log.Error("Link "+aLinkText+" was not found.");
}
else {
Log.Checkpoint("Link " + aLinkText + " found.")
}
}
I've attached two pictures of a closed and open login panel. I invoke closeButton() method with the panel open.
Thanks very much for any advice or suggestions.
Regards, Curt Hicks