Contributions
Re: Exception handling problems
OK I managed to solve that thanks to your tips. Here is what I've done: procedure TryTest; var path, obj :OleVariant; begin path := Sys.Process('WindowsFormsApplication1').WinFormsObject('Form1').WinFormsObject('tabControl2').WinFormsObject('tabPage3'); obj := path.WaitWinFormsObject('aprButtonEdi', 0); if obj.Exists then Log.Message('true') else Log.Message('false'); //Evaluate(path.FullName); end; This condition is handling what I need. Thank you very muchRobertMartin304Views0likes0CommentsRe: Exception handling problems
You're right. One of waitNNN function is what I need. But to call it, I need a refference to the object because it's called like TestObj.WaitNNN. To have a refference for such object I must call Evaluate which looks like this: Evaluate(ApplicationWindow.FullName+'.WinFormsObject(''tabControl2'')'+'.WinFormsObject(''tabPage3'')'+'.WinFormsObject(''aprButtonEdi'')' which will cause test stop because path is incorrect due to non existing object under it. And As you already stated, it will not cause delphi exception.1.4KViews0likes0CommentsUsing large numbers of Evaluate methods in the project
I'mcurrentlyresearching something on the big project for my company. I currently ran into the problem of catching errors in the Evaluate method, which made me thinking about different solutions. @RobertMartin - I can't post you exact example of my code, because I'm not in the work place anymore, however I'll do that right away tommorrow morning. Concerningthis threadof course. Back to the point anyway. I'm doing a lot of customization in my project. I'm creating a .NET application that communicates with TestComplete (it's basically creating ODT test structure and sending it to the TestComplete). I have to make my tests as fast as possible, and don't want to "kill" the testing machine either. So, should I even consider the idea of sending EVERYTHING to TestComplete as a string and make him evaluate each such string? (I know it sounds crazy, will probably cost a lot of resources, and is overally stupid - but just making sure) About the second idea, which sound more reasonable: For now I was creating objects by evaluating Sys.Process.[rest_of_the_path]. It gives me a refference to the object. However I was thinking about using Aliases instead. To do that I need to map a lot of objects for testing. What worries me is that I'll need to use Evaluate method every time I'm calling the object (it's because the path to the mapped object is like Aliases.Form1.Panel1.TabList1.Tab1.TextBox and I'll be building that path programically every time). I was wondering if I should ever consider that due to large resource costs (because largenumbersof evaluate would cost a lot right?)26KViews0likes1CommentException handling problems
Hello I'm encountering serious issue with exception handling. I'm trying to handle such code fragment (delphi script): try Self.objectRefference.Clickzzzzzzz except Log.Message('exception caught'); end; Obviously there is no such method as Clickzzzzzzz - my point is to prevent the test from stoping, but such code fails at this. Test stops, and the except block is not even beeing executed. I'd appreciate any tips on that. Regards19KViews0likes10Comments