Posted: 15 May 2017 15:13 EDT Last activity: 6 Nov 2018 20:02 EST
WaitforCreate not matching as it should
I have added an automation to my existing 6.2 project to pull data from a screen already interrogated for a text adapter. Using either a waitany or a waitforcreate, while the screen is obviously displayed, the wait returns false ... unless I run another automation first that reads that same screen during its execution - then the wait on the new automation returns true and everything is fine. There are many other screens displayed and read in-between the running of these two automations. I've checked the matching in the interrogator and it is fine. This is a simple routine and should work easily. Any suggestions or explanations?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
The first question I would have is what emulator are you using? and then which Text Adapter you are using? Second, question is why you are on an unsupported version? and specifically which version of 6.2? There have been many changes in the last 3 years and I can't really speculate on what could be your issue. The features you are referring to work fine in the latest version which I use each day.
I'm interfacing to a PCOMM customer information system - an old one and have had this project running for many years without this type of issue. So I'm using a windows adapter as my emulator adapter and a IBM PCOMM WINHLLAPI adapter for the text adapter. I've got many automations that talk to the PCOMM application as that is my primary application for the solution. This is a new problem and I'm not doing anything different that I've done for many other automations and its worked fine in the past. I will be upgrading this year to a supported version but for now, I am where I am and was just hoping that someone else had run into this problem and had a solution. I'm running the VS plugin version 6.2.54. Last week I started received a ResGen error during the build (and was also having the problem mentioned with the wait commands) and I upgraded to .net 4.6.2 and that took care of the ResGen error, but not the Wait error.
Let me clarify further - on a waitany, if the screen causing the problem is the one displayed, the error returned is "Object reference not set to an instance of the object." Putting a try/catch around the routine and handling the error indicates that the automation is following the path coming off of the waitany for the screen in question. The real mind boggler is that is I run a different automation within the project, before running this new automation, then everything works perfectly. That doesn't make sense to me.
So is this just a particular screen? When you look at the logs what do you see? I would expect to see the screen show up in the log, then a message like this:
DidScreenTextChange: Screen has changed by more than 2 characters. Field requery will take place if designing
I don't have access to a 6.2 system so this message may be slightly different. At that point you should see the current screen and its control detach and then matching take place on the new screen. If this is not happening, have you changed any settings on the adapter?