mathare
13 years agoContributor
Should I use Connected Applications?
I'm in the very early stages of automating testing for a .NET application written in C# and am still feeling my way around. I am pretty sure that scripted tests rather than keyword tests are the right way forward for this project and plan to build up a library of common functions much like one would for almost any development project. However, I'm not sure how best to go about this really.
I started off with the TestComplete IDE, writing some VBSript code in there but found the IDE rather basic and annoying. Maybe I've been spoiled by things like ReSharper for Visual Studio and even the VBA code editor running behind MS Office apps but I really miss things like auto-indenting, correcting caps etc. I find with TestComplete's IDE I have to think about how my code looks/reads as much as what it actually does whereas other IDEs I do odd bits of coding in will tidy certain aspects of the code up for me as I go along. So I started to look into alternatives and read about connected applications. It seemed like I could write all my code in the Visual Studio IDE after adding in a couple of TestComplete libraries and all would be good.
Initially this solution looked promising and I have roughed out a couple of basic functions that I can build upon but I have found that debugging the code can be a real pain. Now I am wondering if the connected application route is really the right one...
1. When should/shouldn't one use connected applications?
It's not clear at this stage how much of the application code I need to call directly. The idea is to interact with the application via the UI as much as possible (as a user would) but I am not completely ruling out the need/desire to call application code directly at some point.
I'd also hoped that by using connected applications I could encourage one or two of our developers to write some test code too. After all it would be in C# and could be written in Visual Studio - at least that was my thinking initially but now I realise that the syntax is different and that might confuse/annoy our developers.
2. What resources are there available for helping new users get started with connected applications?
I have read the TestComplete help docs in this area and had a look at the samples supplied with TestComplete but most of what I want to do doesn't seem to be covered by those examples and I find myself wanting some sort of language reference or more advanced example of how to do certain things.
Perhaps it's also a lack of understanding on my part. Maybe I'm slightly missing the point of using connected applications. The TC help makes it sound like the ideal solution for getting developers more involved in testing: "The entire TestComplete engine is an OLE server that can be accessed through TestComplete’s user interface or run directly from your application’s code using the application’s language, classes, types and constant definitions. You can also use your development tool’s IDE, including its debugger."
We could run TC tests direct from the code, calling application code where necessary and do it all in C# in Visual Studio. Sounds perfect
but is there something I am missing?
3. I'm struggling to get to grips with the var type, any help/advice?
For example, I get a lot of red underlines in my Visual Studio IDE and the tooltips say things like:
a) Cannot apply operator '<' to operands of type 'int' and 'AutomatedQA.script.var.VarDelegate' - trying to loop over all items in a list
b) Cannot apply operator '==' to operands of type 'AutomatedQA.script.var.VarDelegate' and 'string' - trying to compare the Text property of a WinFormsObject with a known string
c) Argument type type 'AutomatedQA.script.var.VarDelegate' is not assignable to parameter type 'AutomatedQA.script.var' - writing a WinFormsObject property to the TC log e.g. Log["Message"](w["WndCaption"]);
I am currently stuck trying to programmatically work out whether a variable of type 'AutomatedQA.script.var' contains a known substring and am getting nowhere fast which is why I am questioning the whole connected applications approach.
I read somewhere that it is expected that one would port existing scripts from TestComplete rather than write test code from scratch for connected applications. Does that mean writing test code from scratch in Visual Studio is not a good idea for some reason?
So many questions - sorry.
Mat
I started off with the TestComplete IDE, writing some VBSript code in there but found the IDE rather basic and annoying. Maybe I've been spoiled by things like ReSharper for Visual Studio and even the VBA code editor running behind MS Office apps but I really miss things like auto-indenting, correcting caps etc. I find with TestComplete's IDE I have to think about how my code looks/reads as much as what it actually does whereas other IDEs I do odd bits of coding in will tidy certain aspects of the code up for me as I go along. So I started to look into alternatives and read about connected applications. It seemed like I could write all my code in the Visual Studio IDE after adding in a couple of TestComplete libraries and all would be good.
Initially this solution looked promising and I have roughed out a couple of basic functions that I can build upon but I have found that debugging the code can be a real pain. Now I am wondering if the connected application route is really the right one...
1. When should/shouldn't one use connected applications?
It's not clear at this stage how much of the application code I need to call directly. The idea is to interact with the application via the UI as much as possible (as a user would) but I am not completely ruling out the need/desire to call application code directly at some point.
I'd also hoped that by using connected applications I could encourage one or two of our developers to write some test code too. After all it would be in C# and could be written in Visual Studio - at least that was my thinking initially but now I realise that the syntax is different and that might confuse/annoy our developers.
2. What resources are there available for helping new users get started with connected applications?
I have read the TestComplete help docs in this area and had a look at the samples supplied with TestComplete but most of what I want to do doesn't seem to be covered by those examples and I find myself wanting some sort of language reference or more advanced example of how to do certain things.
Perhaps it's also a lack of understanding on my part. Maybe I'm slightly missing the point of using connected applications. The TC help makes it sound like the ideal solution for getting developers more involved in testing: "The entire TestComplete engine is an OLE server that can be accessed through TestComplete’s user interface or run directly from your application’s code using the application’s language, classes, types and constant definitions. You can also use your development tool’s IDE, including its debugger."
We could run TC tests direct from the code, calling application code where necessary and do it all in C# in Visual Studio. Sounds perfect
but is there something I am missing?
3. I'm struggling to get to grips with the var type, any help/advice?
For example, I get a lot of red underlines in my Visual Studio IDE and the tooltips say things like:
a) Cannot apply operator '<' to operands of type 'int' and 'AutomatedQA.script.var.VarDelegate' - trying to loop over all items in a list
b) Cannot apply operator '==' to operands of type 'AutomatedQA.script.var.VarDelegate' and 'string' - trying to compare the Text property of a WinFormsObject with a known string
c) Argument type type 'AutomatedQA.script.var.VarDelegate' is not assignable to parameter type 'AutomatedQA.script.var' - writing a WinFormsObject property to the TC log e.g. Log["Message"](w["WndCaption"]);
I am currently stuck trying to programmatically work out whether a variable of type 'AutomatedQA.script.var' contains a known substring and am getting nowhere fast which is why I am questioning the whole connected applications approach.
I read somewhere that it is expected that one would port existing scripts from TestComplete rather than write test code from scratch for connected applications. Does that mean writing test code from scratch in Visual Studio is not a good idea for some reason?
So many questions - sorry.
Mat