Jump to content


Photo
- - - - -

Can't run test case :-(


  • Please log in to reply
16 replies to this topic

#1 turtle

turtle
  • Members
  • 4 posts

Posted 09 April 2011 - 06:17 PM

Hi all!

I learn VI Tester. I have a problem with run Tast Case. I add MyTestCase.lvclass to project by
manual: http://forums.jki.ne...ting-new-tests/
I run Menu>>Tools>>VI Tester>>Test VIs...
and in Test Hierarchy are not test cases. What do I wrong?

Thank you!
  • 0

#2 Jim Kring

Jim Kring
  • JKI Team
  • 1,267 posts

Posted 09 April 2011 - 06:54 PM

Hi all!

I learn VI Tester. I have a problem with run Tast Case. I add MyTestCase.lvclass to project by
manual: http://forums.jki.ne...ting-new-tests/
I run Menu>>Tools>>VI Tester>>Test VIs...
and in Test Hierarchy are not test cases. What do I wrong?

Thank you!


Once you have the VI Tester window open, try selecting File >> Open Project of Test Class and then browse to your project (.lvproj) or test case/suite (.lvclass) file. Does that work for you?
  • 0

#3 Omar Mussa

Omar Mussa
  • Members
  • 92 posts
  • Gender:Male

Posted 10 April 2011 - 03:50 AM

What do I wrong?


Try saving the .lvproj file and seeing if the tests appear (relaunch VI Tester UI after saving .lvproj file).
  • 0

#4 turtle

turtle
  • Members
  • 4 posts

Posted 10 April 2011 - 08:25 AM

Once you have the VI Tester window open, try selecting File >> Open Project of Test Class and then browse to your project (.lvproj) or test case/suite (.lvclass) file. Does that work for you?

I try it. It does not work.

And I try save project, and open again, run Tools>>VI Tester>>Test VIs...
It does not work.

I try on 3 configurations:
1) Win 7 64 bit + LabVIEW 10.0f1 32-bit + VI Tester (jki_labs_tool_vi_tester - 1.1.2.164-1, jki_rsc_toolkits_pallette - 1.1-1);
2) Win XP 32 bit (On VMware) + LabVIEW 10.0 32-bit + VI Tester (jki_labs_tool_vi_tester - 1.1.2.164-1, jki_rsc_toolkits_pallette - 1.1-1);
3) Win XP 32 bit + LabVIEW 10.0 32-bit + VI Tester (jki_labs_tool_vi_tester - 1.1.2.164-1, jki_rsc_toolkits_pallette - 1.1-1).

May be something wrong with my project? I place my project in placement.
  • 0

#5 Omar Mussa

Omar Mussa
  • Members
  • 92 posts
  • Gender:Male

Posted 10 April 2011 - 03:46 PM

May be something wrong with my project? I place my project in placement.


Sorry that you're still having trouble. What are your default language settings? It could be a localization issue. My last suggestion if you have time to check this - try downgrading VI tester to the previous version from VIPM (restart LabVIEW after installation) and see if that works.

I'll try to reproduce your issue at work tomorrow (Monday).
  • 0

#6 Omar Mussa

Omar Mussa
  • Members
  • 92 posts
  • Gender:Male

Posted 11 April 2011 - 05:13 AM

I think I know what's wrong - its actually a documentation bug in our manual. We refactored the template TestCase object so that when its instantiated, you have a method called 'testExample.vit' (whereas it used to instantiate testExample.vi). The VI Tester frameworks is 'smart' enough to know that .vit files are not meant to be run as tests, so they are not added to the tree. To create a test, right click on the the 'testExample.vit' file and select 'New Method from Template'. Create a name for this method such as 'testXXX.vi' where XXX where XXX is anything you want (example: 'testVITesterUI.vi'). Now that the TestCase actually contains a test, the class will show up on the tree.

NewMethod.png

That should get you past the roadblock. Another option is to open the example project (Help-->Open Example Project) and that will also work.
  • 0

#7 turtle

turtle
  • Members
  • 4 posts

Posted 11 April 2011 - 01:15 PM

Sorry that you're still having trouble. What are your default language settings? It could be a localization issue. My last suggestion if you have time to check this - try downgrading VI tester to the previous version from VIPM (restart LabVIEW after installation) and see if that works.

I'll try to reproduce your issue at work tomorrow (Monday).


Yes, I install VI Tester previous version 1.1.1.137-1, and trouble is absent.

I have all hosts with default Russian locale (1251).

At Last version 1.1.2.164-1, if I do "testExample.vit>>context menu>>new form template" testExample.vi appear in project. But I still having a trouble.
Last version VI Tester (after update) work correctly with my project, created by previous version VI Tester.

Thank You for Help!
  • 0

#8 Omar Mussa

Omar Mussa
  • Members
  • 92 posts
  • Gender:Male

Posted 12 April 2011 - 12:04 AM

Yes, I install VI Tester previous version 1.1.1.137-1, and trouble is absent.


That's great! I'm glad you're making progress. So, the reason for this is that we changed the way VI Tester works - it used to load the test classes into memory to find the test methods. This was very slow for large projects, so we changed the code to discover test methods by inspecting the class on disk. We need a warning flag if you try to load a TestCase with unsaved changes as it may not show up in your test list (Added to 'Known issues': Case 10770). Note - once discovered, you can edit the code within the tests while the VI Tester UI is open without any issues - this is just a load time effect.

I have all hosts with default Russian locale (1251).

Can you attach your custom TestCase.lvclass file to this thread? I want to ensure that we don't have a localization issue that would affect you (or other users).

At Last version 1.1.2.164-1, if I do "testExample.vit>>context menu>>new form template" testExample.vi appear in project. But I still having a trouble.

What trouble are you having? Make sure the TestCase is saved after you add the testExample.vi.

Thank You for Help!


Thanks for your patience! I'm pretty confident that you'll be able to run unit tests without any issues once you get past these initial hurdles.
  • 0

#9 turtle

turtle
  • Members
  • 4 posts

Posted 12 April 2011 - 12:10 PM

Can you attach your custom TestCase.lvclass file to this thread? I want to ensure that we don't have a localization
issue that would affect you (or other users).

Yes, see in attachments "Failue_VI_Tester_Project.zip".

My fault: I don't save project after do "testExample.vit>>context menu>>new from template". If save project, VI
Tester finds test case "test Example 2.vi". This is "Success_VI_Tester_Project.zip".

Best Regards!

Attached Files


  • 0

#10 Omar Mussa

Omar Mussa
  • Members
  • 92 posts
  • Gender:Male

Posted 12 April 2011 - 04:00 PM

My fault: I don't save project after do "testExample.vit>>context menu>>new from template". If save project, VI
Tester finds test case "test Example 2.vi".


Good to know. We'll definitely look into adding warnings about unsaved changes to the .lvclasses, as this is a usability issue. What we are trying to do is avoid loading the .lvclass into memory unnecessarily - it adds a lot of time depending on your class hierarchy, size, etc. But ideally, this should be transparent to VI Tester users. Thanks for your help. Please post more feedback as you use the product.
  • 0

#11 Rob Calhoun

Rob Calhoun
  • Members
  • 5 posts

Posted 08 July 2011 - 06:27 PM

That's great! I'm glad you're making progress. So, the reason for this is that we changed the way VI Tester works - it used to load the test classes into memory to find the test methods. This was very slow for large projects, so we changed the code to discover test methods by inspecting the class on disk.


This is a funny (well, sad, really) thing about LabView these days; walking the project hierarchy is mind-bogglingly slow. We wrote a quick-drop-like tool (before quick drop) for user VIs. We used to scan the project hierarchy so we could properly assign each VI to a project and ignore irrelevant ones, but it was hundreds of times faster to simply do a recursive filesystem search for all labview files below the .lvproj file, so we switched to that.
  • 0

#12 Rob Calhoun

Rob Calhoun
  • Members
  • 5 posts

Posted 08 July 2011 - 08:52 PM

Good to know. We'll definitely look into adding warnings about unsaved changes to the .lvclasses, as this is a usability issue. What we are trying to do is avoid loading the .lvclass into memory unnecessarily - it adds a lot of time depending on your class hierarchy, size, etc. But ideally, this should be transparent to VI Tester users. Thanks for your help. Please post more feedback as you use the product.


Here are three things that make the VI Tester behave in unexpected ways to a new user:

  • Test Cases that do not have any test methods do not appear in VI Tester hierarchy. (Maybe this is a feature, but it's not what I would expect.)
  • After creating and saving a new test method the Test Case still does not appear in the VI Tester hierarchy. This is because the Test Case (class) has not been saved, so it still has no test methods from the point of the VI Tester
  • Only test methods that start with the word "test" (at least this appears to be case-insensitive) are considered test methods.

The first of these should get fixed; the hierarchy should show the Test Case even if it has no methods.

The second is a design flaw in LabView that causes no end of trouble. LabView classes have this irritating behavior of being both cross-referenced (a method knows it is part of a class, and a class knows it is part of a member) AND comprised of multiple files thus requiring multiples save operations. Not only is it causing trouble here, the design makes it is easy to quit LabView with the class in an inconsistent state.

Back to the VI Tester. I can't figure out the logic behind the third item above. I agree it's a convention, and conventions are good, but when would you want a method that is a method of a Test Case class, but not one of {setUp|tearDown|testMethod}? If this is desired (I can accept there are valid use cases), is there a less quirky implementation? This one is not very friendly to non-English speakers (or English-speaking newbies, for that matter.)

I was kicking around whether one could solve this by making Test Methods from a dynamically dispatched template, but that doesn't really solve anything. Anyway, the name requirement needs to be spelled out in bold face type. At present the VI Tester is quite frustrating to use at first because it's hard to figure out what you need to do to make a test that will be recognized. (I could run the example tests, but I couldn't run any of my own!)

-Rob
  • 1

#13 CharlesB

CharlesB
  • Members
  • 4 posts

Posted 01 October 2013 - 12:08 PM

Hi,

Here are three things that make the VI Tester behave in unexpected ways to a new user:

  • Test Cases that do not have any test methods do not appear in VI Tester hierarchy. (Maybe this is a feature, but it's not what I would expect.)
  • After creating and saving a new test method the Test Case still does not appear in the VI Tester hierarchy. This is because the Test Case (class) has not been saved, so it still has no test methods from the point of the VI Tester
  • Only test methods that start with the word "test" (at least this appears to be case-insensitive) are considered test methods.


I agree with this list, and last point should really be made clearer to new users, I was hit by this too.

By the way, is VI Tester still maintained? A quick browse of the forum shows known bugs, and enhancements that should be straightforward to implement, but the last release is nearly 3 years old...

Thanks anyway for making it available!

Edited by CharlesB, 01 October 2013 - 12:28 PM.

  • 0

#14 Jim Kring

Jim Kring
  • JKI Team
  • 1,267 posts

Posted 01 October 2013 - 04:36 PM

I agree with this list, and last point should really be made clearer to new users, I was hit by this too.

By the way, is VI Tester still maintained? A quick browse of the forum shows known bugs, and enhancements that should be straightforward to implement, but the last release is nearly 3 years old...

Thanks anyway for making it available!


Hi Charles! Thanks for the feedback on your getting started experience. I agree that these three things could be improved.

Yes, VI Tester is still maintained, minimally at the moment, but (fairly) we'd love to be able to give it even more love than we're able to right now.


Let's keep the dialog going. It's great to hear that people use/love VI Tester and it motivates all of us at JKI!
  • 1

#15 tyk007

tyk007
  • Members
  • 4 posts

Posted 03 December 2013 - 08:36 PM

Hi Charles! Thanks for the feedback on your getting started experience. I agree that these three things could be improved.

Yes, VI Tester is still maintained, minimally at the moment, but (fairly) we'd love to be able to give it even more love than we're able to right now.


Let's keep the dialog going. It's great to hear that people use/love VI Tester and it motivates all of us at JKI!


I would love to make more use out of VI Tester, but since I'm using LabVIEW 2012 and 2013, the TestCase-From-Template bug that has been posted on the forums by shb causes us a lot of grief making it significantly more awkward to use than NI's UTF. Is there any news on when any updates might be made? Or (dare I ask) the possibility of opening up the VIs to allow the community to make these modest improvements?
  • 0

#16 Jim Kring

Jim Kring
  • JKI Team
  • 1,267 posts

Posted 27 February 2014 - 04:57 AM

Hi Everyone. We just released a new version (1.1.2.274) of VI Tester with a fix for this issue!

You can get this new version by checking for package updates with VIPM.


Thanks for your great feedback and patience. :)
  • 0

#17 CharlesB

CharlesB
  • Members
  • 4 posts

Posted 04 April 2014 - 02:10 PM

Hi Everyone. We just released a new version (1.1.2.274) of VI Tester with a fix for this issue!

You can get this new version by checking for package updates with VIPM.


Thanks for your great feedback and patience. :)


Thanks for the update!
Sorry for reporting a problem once again. I'm overall satisfied. But with this release, in the new templates, a very useful comment was removed in "setup": "If references opened in setUp, then keep this frame enabled".

The frame contains "wait on testcomplete", effectively mandatory if you rely on opened references, and I removed it, thinking it was related to real-time target (which is the displayed case when you open the diagram). Fortunately I could find what the problem was, but it took me some time!
I was imprudent, but with the previous comment I wouldn't have removed it.
  • 0