Forum Discussion

dhundley's avatar
dhundley
Regular Contributor
4 days ago

same keyword test for browser based app sometimes displays objects, sometimes does not.

i have developed a testcomplete automation for one of our browser based applications. the start of every test case (12 in total, so far) utilizes the exact same keyword test that launches a chrome browser and navigates to the same URL. Almost without exception, one of the 12 test cases (and not the same one every time) will experience the following behavior.

First, let me show you what it looks like for one of the other 11 that is successful. note all the objects are visible on the web page in the screen shot

now, for a different test case running the exact same keyword test it will look like this

it still finds the text boxes as mapped objects (the red rectangle) and i've verified that both the Visible and VisibleOnScreen properties are true but they do not appear in the screenshots represented by the Has Image column of the results log. at the end of this keyword test (after filling in all the text boxes with data), a Continue button is supposed to be enabled and clicked. attempting to click the Continue button is where the test case fails every time the web page exhibits this behavior because it is not enabled because the data has not actually been entered into the objects. when the objects appear in the image the data does get entered and the Continue button click is always successful. 

Has anyone ever seen this type of behavior in TestComplete? 

  • Although it doesn't address the root cause, I would be tempted to try to workaround the problem.  For instance, check if the Continue button is enabled after you populate the other fields.  If not clear the browser cache, reload the page and try the process again.  I'd do it in a loop that only tries again once or twice so you don't get stuck in it.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I remember seeing similar issues in version 14, but haven't seen it since. I'm current using v15.55.53.7.

    If you watch your automation run, does the web page fully load? Do you have a delay mechanism, to wait for the web page to be fully loaded?

    • dhundley's avatar
      dhundley
      Regular Contributor

      first, i am using the latest release of testcomplete/testexecute (15.67). 

      at your suggestion i tried implementing a page.Wait() operation immediately following the Run method that loads the URL and even added a manual 10 second delay after that.

      after my first two test cases completed successfully the third failed on the line highlighted in the image above with the indication that it was simply "unable to navigate to the page" of the URL. then, in my onstoptestcase event handler when i try to ensure that the browser window is closed if the test case has failed, it began doing this until the whole thing just stopped because of a recursive call to the handler. why does it say the object browser window does not exist when it is clearly being display on the screen? i'm open to any more suggestion you or anyone else might offer

       

  • Although it doesn't address the root cause, I would be tempted to try to workaround the problem.  For instance, check if the Continue button is enabled after you populate the other fields.  If not clear the browser cache, reload the page and try the process again.  I'd do it in a loop that only tries again once or twice so you don't get stuck in it.

    • dhundley's avatar
      dhundley
      Regular Contributor

      we think alike. since the continue button is not enabled until after the text boxes are filled i coded my workaround like this

      launch browser/URL

      while (continue button is disabled)

      {

           // fill in text  boxes

           if (continue button is disabled)

           {

                close browser

                relaunch browser/URL

           }

      }

      click continue button

       

       

      this appears to be working for now.