| || |
Using C# and AOM
I'm developing a solution to launch QTP via the AOM using C#
I've made a reference to the Quick Test Application object within the project and everything seems to work fine except for trying to set the Environment value.
When I do this in vb.net it works fine but when I attempt this in C# I get an error and can't seem to get the syntax correct for this to work..
Here's what I'm doing:
<font class="small">Code:</font><hr /><pre>
oQTPApp.Test.Environment.Value("AUT_Version") = szAUT_Version;
Here's the error:
"The left-hand side of an assignment must be a variable, property or indexer ..."
Any ideas how this occurs and how to resolve this?
Re: Using C# and AOM
C# doesn't work the way VB does. When you use dynamic objects you need to Invoke the proper methods. I remember seeing a post on the forum which has code for the way it needs to be done. So search for that.
Also if you are using .NET 4 then you can actually use the dynamic keyword and then your existing code may work