NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I activate an HTML file from the tools menu?

I understand how to add a custom entry to the TestStand 4.0 Sequence editor using the TOOLS->CUSTOMIZE... menu selection, but I want to:

1) Activate an HTML page when the TOOLS menu option is selected

and

2) Provide the directory of the current sequence file to the HTML

and

3) Disable this new menu selection if the current sequence file has not been saved.

0 Kudos
Message 1 of 7
(3,843 Views)

Probably the easiest thing to do is create a tool menu sequence file and add a tool menu item that calls a sequence in it. In the sequence use a call executable step type to launch IE or whatever webbrowser you prefer. Also in the sequence you can access the directory of the current sequence file by using RunState.IntialSelection.SelectedFile.Path. Also you can disable the tool menu with an expression similar to:

 

PropertyExists("RunState.InitialSelection.SelectedFile") && RunState.InitialSelection.SelectedFile.AsPropertyObjectFile.IsModifiedByUser

 

Hope this helps,

-Doug

0 Kudos
Message 2 of 7
(3,839 Views)

Ok.

 

I'm trying something slightly different than you suggested.  See if this makes sense:

 

I've created a COMMAND item for the tools menu.  The command is IE (C:\Program Files\Internet Explorer\iexplore.exe) and the arguments field is the HTML file (D:\foo\bar\myfile.html).  Would it be possible to use the GET capability of HTML and pass the RunState.IntialSelection.SelectedFile.Path like this:

    D:\foo\bar\myfile.html?mypath=RunState.IntialSelection.SelectedFile.Path

 

If not in a COMMAND, how could this be done in a sequence file?

0 Kudos
Message 3 of 7
(3,818 Views)

The reason I recommended using a sequence with call executeable step rather than using the Command setting for the tool menu item is that TestStand currently does not support specifying an expression for the arguments to the executeable with the Command setting. The callexecuteable step type on the other hand does support this. With the call executeable step type you can use the value of variables to build your arguments. I am not an expert on HTML or Internet Explorer though so I don't know how if HTML or Internet Explorer supports exactly what you are trying to do.

 

Hope this helps,

-Doug

 

0 Kudos
Message 4 of 7
(3,791 Views)

Thanks for the clarification of your suggestion.  I have created a sequence with a single step: "Call Executable".  In the Executable Pathname field I have specified iexplorer.exe.  When I specify a specific HTML page in the Argument Expression field (i.e., "D:\Test.html") the sequence runs fine and properly activates IE showing the specified HTML file.  If I just specify a directory in the Argument Expression field (i.e., "D:\Foo\Bar") the sequence runs fine and properly activates IE showing the specified directory.

 

However, when I put RunState.InitialSelection.SelectedFile.Path into the Argument Expression field, it doesn't show the directory.  Do I have to do something special in order to get RunState.InitialSelection.SelectedFile.Path properly interpreted when the sequence is executed?

0 Kudos
Message 5 of 7
(3,762 Views)

did you have a step selected in the sequence view?

 

regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 7
(3,758 Views)

RunState.InitialSelection.SelectedFile.Path is the full path to the sequence file. You will need to parse out the file name from that first. You can parse out just the directory name with the following expression:

 

Left(RunState.InitialSelection.SelectedFile.Path, Find(RunState.InitialSelection.SelectedFile.Path, "\\", 0, False, True))

 

-Doug

0 Kudos
Message 7 of 7
(3,736 Views)