Forum Discussion

chicks's avatar
chicks
Regular Contributor
13 years ago

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


  • Hello Curt,

    Actually, the behavior you describe resembles the incorrect web control coordinates issue that used to occur in TestComplete's version prior to 8.70. What version of TestComplete are you using? Does the issue occur on TestComplete 8.70 or on the latest version of TestComplete - 9.0?

    Could you please specify whether the issue occurs only when you try to simulate clicks on this particular button or on any other element on your tested web page?

    Also, could you please specify how you implement click actions in your Click routine? Do you use coordinates to determine where the click should be performed? Could you please post here the code of your Click routine?

    Thanks in advance.
  • chicks's avatar
    chicks
    Regular Contributor
    I'm using 8.60.665.7  I had problems converting to TC 9.0 when I first attempted it and have not switched back.

    It sounds like this is a known problem?    Is there a work-around other than updating to a new version?



    I'm actually using  the .SetText method on the other elements, so don't know whether the other keys can be clicked or not.



    Here is my Click routine.

    function Click(linkOrButton)

    {

    if(linkOrButton.Exists)

      {

       linkOrButton.Click();

       Sys.Process("iexplore").Page("*").Wait();

      }

    else

     {

      Log.Error("Couldn't find object to Click.");

       //throw exception;

      }

    }

  • Hello Curt,

    Thank you for the provided information.

    That problem was fixed in TestComplete 8.70. Could you please update your TestComplete version to 8.70 and check whether the issue still persists?

    Also, could you please describe the problems you faced when converting to TestComplete 9.0? We will try to solve them.

    Thanks in advance.
  • chicks's avatar
    chicks
    Regular Contributor
    The problem is not currently happening with TestComplete 9. 



    (The issue when I tried to convert to TC9 was the registry key fix TabProcGrowth DWORD 0  for multiple IE processes. TC9 started working once I reset the registry key.)