Jump to content

[FIXED in 3.0] DOM reference is lost when passed from Setup to test VI


Bhargavi

Recommended Posts

Hi all,

I have faced an issue with JKI VI Tester. Here are the details..

I am creating a DOM reference in "Setup.vi" and bundling it into my TestCase Object. DOM reference can be created by using "Load.vi" from XML Parser palette(attached image-> XML Parser palette and DOM Ref.png).

962372318_XMLParserpaletteandDOMRef.png.0fa7e22c05ff3602852134125f3786f1.png

When I unbundle it in the test VI, the DOM is reset to '0'. It is getting lost.

We digged into the VI Tester and found out that some deprecated property nodes are used in "_JKI Toolkits\VI Tester\TestCase.llb\CallTestMethod.vi" in order to pass data from one VI (Setup VI) to another VI (Test VI).Refer to attached images -> VI Tester_Set Control.png, VI Tester_Get All.png.

1974192911_VITester_SetControl.png.e7268c15a13b5c4d4ea47e3aa50c2b01.png

1669065771_VITester_GetAll.png.6003f423ef74d232bef85af86a54bd8e.png

When the DOM reference is flattened it is getting lost, because LabVIEW doesn't know how to convert DOM reference into flattened data type. 

We have done a quick internal fix by replacing the property nodes and using variant to data after getting the control value. These changes are shown in  "VI Tester_Set Changed.png" and "VI Tester_Get_Changed.png".

40657274_VITester_Get_Changed.png.b5dc7e770562b1f73ac5a0ba3153802c.png

362195042_VITester_SetChanged.png.9956fae7629413e1d574a27f4c3be9bd.png

Also, in "_JKI Toolkits\VI Tester\TestCase.llb\WaitOnTestComplete.vi", we have replaced the property node when parent data is written to child class indicator. This change is shown in "WaitOnTestComplete.png".

WaitOnTestComplete.png.c65fa39f188171fc791a6f7b5279bf49.png

I am getting my DOM reference in test VI correctly after doing this change.

As I said this is a quick fix done for internal purpose. If this is the right change to make it work, can you please make this change and distribute the package so that my customers can also use it. If this is not the right change to be made, please suggest us how to fix this. Also, let me know if you can fix this issue and and release the fixed version. 

Please let me know if any other information is needed regarding this.

Thanks,

Bhargavi Gowri.  

Link to comment
Share on other sites

  • 2 weeks later...

Hi @Jim Kring,

I am facing the same issue(document reference getting lost) when I create my object(this object private data contains document reference) in the "New.vi" of Test Suite.

I observed that when I create the document reference in "New.vi" and use it in my test case the document ref is lost.

Please let me know if this issue can be solved or I should find other alternatives to make my test work.

Thanks,

Bhargavi Gowri.

 

Link to comment
Share on other sites

Hi @Bhargavi,

Thank you for posting this example project. The breakpoints do a great job of showing the problem you're seeing.

I did find that some of the deprecated control value methods are being used and the typecasting issue is present (and those should probably be replaced with the variant counterparts). However, that's not the only/main problem at hand.

Another big issue I see is that the TestSuite's New.vi method is being called when VI Tester first loads the Test Suites, and then the New.vi goes idle, which means that any references created inside of New.vi will get disposed of automatically by LabVIEW (when the VI goes idle).  VI Tester works around this with the TestCase and TestSuite setUp.vi using the TestCase.lvclass:WaitOnTestComplete and TestCase.lvclass:WaitOnTestComplete VIs, which keep setUp.vi running until the test case/suite completes.

However, that's not exactly what you're after -- you're trying to initialize the data of the TestCase inside the TestSuite New.vi.

I'll need to think about this some more, to see if there's a good solution.

 

Link to comment
Share on other sites

1 minute ago, Bhargavi said:

I have moved to the approach of creating the DOM reference in setUp.vi of Test Suite. I will let you know if I face any problem.

OK, I think that's the best approach. I think that we may still need to fix some of the flattening/unflattening issues inside of TestSuite.lvclass:WaitOnTestComplete.vi (and the TestSuite runner), in order for the reference to be valid.

Link to comment
Share on other sites

Hi @Jim Kring,

Thanks for sharing the build:). I will try it and let you know if it works fine for me.

I am accessing the reference in TestCase by passing it through functional global. I didn't find any other way to do it as of now. Please let me know if there is any other way.

Thanks,

Bhargavi Gowri.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.