04-30-2010 08:30 AM
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.
04-30-2010 09:32 AM
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
04-30-2010 02:17 PM
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?
05-03-2010 09:35 AM
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
05-05-2010 07:18 AM
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?
05-05-2010 08:16 AM
did you have a step selected in the sequence view?
regards
Ray Farmer
05-06-2010 10:01 AM
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