Jump to content
Bhargavi

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

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.  

  • Like 1

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

Hi @Bhargavi

Would you be able to create a very small test project (and zip+attached it) that demonstrates the issue? That will make it easier to debug.

Thanks!

Share this post


Link to post
Share on other sites

Hi @JimKring

I have attached the sample project, which demonstrates the issue that I am facing. I have also attached the image, which shows the DOM ref values in New.vi of test suite and setUp.vi of the test case. Please let me know if you need any details.

Thanks,

Bhargavi Gowri.

Sample Code.zip

DOM Ref is Lost.png

Edited by Bhargavi
  • Like 1

Share this post


Link to post
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.

 

Share this post


Link to post
Share on other sites

Hi @JimKring,

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.

For now,

Thanks,

Bhargavi Gowri.

  • Like 1

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Hi @JimKring,

You are right. Similar to the one in test case "setUp.vi" we have to fix in test suite "setUp.vi".

If you are going to make those changes, can I know when I can expect the fixed version?

Thanks,

Bhargavi Gowri.

Share this post


Link to post
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.

 

Edited by Bhargavi

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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