Question about : "Knowledge Base Article # Q200215"
Yuval S.
Tel Aviv,

Jul 29, 2020
8 Posts

0  |  0  

Re: Question about : "Knowledge Base Article # Q200215"

Hi All,

Trying to follow step by step and implement exactly like mentioned in the article :

https://www.marvintest.com/KB/Q200215/Accessing-ATEasy-Internal-Classes-from-other-programming-languages

i cannot figure out how i define "data" in this line: data=new ClassLibrary1.Class1()
from this section:


Test 1.1 : "Call Method"
--------------------------------------------------------------------------------
Id = Call_Method
Type = MinMax
{
!Create instance of .NET class
data=new ClassLibrary1.Class1()
!Load Test object into variant
varALog=Log
!Load Test object variant into mscorlib.NetObject
obALog=varALog
!Send Test object to .Net DLL along with new properties
data.ATEasyLogClear(obALog)
}

it is not explained in the article... tried everything and still got an error:

Compiler error #682: Right side of assignment is not compatible with left, found in 'Test 1.1 : Call Method' in line 3

Thanks to the helpers !

*Changed by Moderator

Solution Available
DrATEasy (Ron Y.)
Mission Viejo, CA

Jul 29, 2020
334 Posts

1  |  0  

Re: Question about : "Knowledge Base Article # Q200215"

- Under Program Variables insert the variable (insert menu).
- Open the properties Window when the variable is selected
- In the Name field type "data"
- In the Type field select or type "ClassLibrary1.Class1"

Ronnie

*Changed by Moderator

Yuval S.
Tel Aviv,

Jul 29, 2020
8 Posts

0  |  0  

Re: Question about : "Knowledge Base Article # Q200215"

Thanks that worked,
but now after i started to run it, i got this error message:

Run-time error #420 : 'Object method or property 'MyClass' failed: Could not load file or assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.' found in 'Call_Method1' in line 3


Run-time error #419 : 'Object is null' found in 'Call_Method1' in line 9


The c# script :




using System;
using System.Collections.Generic;
using System.Text;

namespace ArrayTest
{
    public class MyClass
    {
        
        static void Main()
        {
        }


        //PURPOSE: Sets the specified values iMin and iMax to the specified ATest object pExtObject        

        public void ATEasyTestSetMinMax(ref Object pExtObject, int iMin, int iMax)
        {
            AteRtLib.ATest ATEasyObject = (AteRtLib.ATest)pExtObject;
            ATEasyObject.Min = iMin;
            ATEasyObject.Max = iMax;
        }

        //PURPOSE: Gets the value of the TestsCount property from the specified ATask object pExtObject and returns it in the reference parameter iTestCount.

        public void ATEasyTaskGetTestCount(ref Object pExtObject, ref int iTestCount)
        {
            AteRtLib.ATask ATEasyObject = (AteRtLib.ATask)pExtObject;
            iTestCount = ATEasyObject.TestsCount;
        }

        //PURPOSE: Executes the specified ALog object pExtObject's Clear() method.

        public void ATEasyLogClear(ref Object pExtObject)
        {
            AteCtlLib.ALog ATEasyObject = (AteCtlLib.ALog)pExtObject;
            ATEasyObject.Clear();
        }


    }  
    }


File Attachment:
Untitled.jpg

DrATEasy (Ron Y.)
Mission Viejo, CA

Jul 30, 2020
334 Posts

0  |  0  

Re: Question about : "Knowledge Base Article # Q200215"

We have revised the KB, please check it again:

https://www.marvintest.com/KB/Q200215/Accessing-ATEasy-Internal-Classes-from-other-programming-languages

Regarding the issue you reported, not sure what version of ATEasy you are using. try to use the latest ATEasy

https://www.marvintest.com/Downloads.aspx?Type=all&keywords=&filename=156d&search=download



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]