chicks
13 years agoRegular Contributor
click action "misses" on jumping button
I'm writing a script to validate the error checking on some address fields. The basic strategy is to fill in an invalid value, then click the "submit" button, in this case the next arrow, and see that the correct error message appears on the page. For example, "this field is required."
The problem I'm having is that the error messages are causing the "submit" button to be repositioned and then my click misses. that is, the next arrow does not get hit. I am not using name space mapping I have written the following javascript functions to find the button.
function signup(){return Sys.Process("iexplore").Page("*");}
function signup_Next_Arrow() {return signup().Find(new Array("ObjectType", "Name"), new Array("Image", "*arrow*right*"), FIND_DEPTH); };
Note that I am passing the function for the button to the routine that clicks it, so there may be a problem with my code there.
function test_step2_EC() {
signup_step2_errorCheck( signup_Next_Arrow );
}
function signup_step2_errorCheck(goButton) {
Log.PushLogFolder(Log.CreateFolder("step 2 - error checks") );
verify_TextField(signup_address_street1(), "", memberPortal(), goButton, "This field is required.");
verify_TextField(signup_address_city(), "", memberPortal(), goButton, "This field is required.");
ClickItem(signup_Select_stateCode(), "");
Click(goButton() );
......
I can clearly see that the Click action is not being centered on the arrow when the script runs, but is above it.
Since I am calling the find function every time, it seems it should not matter that the button is getting repositioned.
In my click routine, I printed the Top property of the button prior to clicking it and I do see that it changes appropriately.
Any comments would be greatly appreciated.
Thanks, Curt HIcks
The problem I'm having is that the error messages are causing the "submit" button to be repositioned and then my click misses. that is, the next arrow does not get hit. I am not using name space mapping I have written the following javascript functions to find the button.
function signup(){return Sys.Process("iexplore").Page("*");}
function signup_Next_Arrow() {return signup().Find(new Array("ObjectType", "Name"), new Array("Image", "*arrow*right*"), FIND_DEPTH); };
Note that I am passing the function for the button to the routine that clicks it, so there may be a problem with my code there.
function test_step2_EC() {
signup_step2_errorCheck( signup_Next_Arrow );
}
function signup_step2_errorCheck(goButton) {
Log.PushLogFolder(Log.CreateFolder("step 2 - error checks") );
verify_TextField(signup_address_street1(), "", memberPortal(), goButton, "This field is required.");
verify_TextField(signup_address_city(), "", memberPortal(), goButton, "This field is required.");
ClickItem(signup_Select_stateCode(), "");
Click(goButton() );
......
I can clearly see that the Click action is not being centered on the arrow when the script runs, but is above it.
Since I am calling the find function every time, it seems it should not matter that the button is getting repositioned.
In my click routine, I printed the Top property of the button prior to clicking it and I do see that it changes appropriately.
Any comments would be greatly appreciated.
Thanks, Curt HIcks