Persistent Object Recognition Hints where page Objects are not found
Hi
I have been using TestComplete for a couple of months now and have inherited many tests which need attention in one way or another. I need your help!
The question I have at the moment is regarding Object Recognition in web browsers.
Currently, the keywordtests use RunTestedApp to launch a Chrome browser and browse to our website URL. Mostly this works fine, however, recently we have been experiencing issues where the Object is not found when trying to perform an action in the browser etc. I remap it (by double clicking and using 'point & fix' then finding the Object on screen) but on a future run it may fail again due to having lost it's Object mapping. This doesn't happen every time but does happen fairly regularly.
Is there a way to stabilise this and give us more confidence in the tests running successfully?
I have been wondering whether the use of TestedApps is the root cause and whether we would be better off using RunBrowser instead. If this is the case, does anybody know what the process would be for incorporating this? Is it simply a case of slotting in RunBrowser into correct place in the keywordtest and the subsequent actions all string together... Or is there more to it? - please excuse my naivety.
All advice welcome. Every day is a school day, as they say! :)
Thanks,
Jenny
The example you've given seems to be a simple problem with timing. The page you are intending to work with is not up and available yet when you attempt to perform the next step which, based on your screenshot is a check point on the FlightLogDetails page. The FlightLog page is what is available at the time so that's why you get the hint.
Most likely, after your click on linkLnbviewdetails163463, your Delay of 200 milliseconds isn't long enough. I would actually recommend not using a hardcoded delay like that. Instead, after that click, you need to insert an onscreen action where you call the Wait method on pageFlightLogDetails. (see https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/page/wait-action-page-object.html) This method will tell TestComplete to wait until that page is fully loaded in your browser before proceeding with your test. This is probably an intermittant problem... sometimes it works fine, sometimes it doesn't, which is the nature of timing issues of this sort.
As a best practice and rule of thumb, if you perform an action on a page that either will cause the current page to reload or navigate to a new page, you should call that Wait method against the destination page. This will wait up to the maximum wait time on your project (Tools -> Current Project Properties -> Playback) for the page to load.