James’ question was handled through support, but in case anyone else had the same question, this is the approach for handling Citrix when applications/desktops are accessed through the StoreFront:
1. Use the Web VU to record the HTTP interaction with the StoreFront
With recent versions of Citrix, the ICA file is still present but it is now dynamically-generated by the StoreFront web interface. Re-usable ICA files are more or less a thing of the past. As such, one needs a web script to simulate that dynamic generation. The resulting ICA file can also not be re-used, and so it is necessary to use this web script in order to start the Citrix recorder as well.
2. Store the dynamically-generated ICA file for later use
Once the Web script is up and running (you may need to perform a few correlations, in particular for a “CSRFToken” that manifests as both an HTTP header and cookie), the ICA needs to be stored in a location where the Citrix VU can later pick it up.
One way to do this is as follows:
SetString("icaFilePath", FilesDataPath + "\\" + VU.Index + ".ica");
This sets up a unique path for where to save the ICA file. FilesDataPath will work regardless of where you run your test, in other words it’ll work on remote injectors as well as localhost. VU.Index is unique per VU group (unlike VU.UniqueId which is unique across the whole test, but is actually not desirable in this case).
Once you locate the request that results in the ICA file response (look for a Content-Type: application/x-ica header), the entire response can be saved as the ICA file as per the below example:
using (Response response94 = request94.Send())
{
#region EPP_AFTER_RESPONSE_RECEIVED for Request 94
// Any code added here will be preserved between regenerations of this script
#endregion EPP_AFTER_RESPONSE_RECEIVED for Request 94
// Rule: Verify that the result code matches what was recorded
response94.VerifyResult(HttpStatus.OK, ActionType.ACT_WARNING);
WriteMessage("ICA response (double-click):
" + response94.Content);
// TM - write it to a temp file:
System.IO.File.WriteAllText(GetString("icaFilePath"), response94.Content);
}
3. Make the Citrix VU wait for the ICA to become available
This can be achieved using the following two methods. These can be put in a script or the custom VU:
private void pollForIca(string path)
{
int counter = 0;
int pollFrequency = 5000;
int maxWait = 60000; // 60 sec
while (counter <maxWait>= maxWait)
{
throw new System.IO.FileNotFoundException(String.Format("No ICA file found after {0}ms. Check the results of the Web VU for errors.", maxWait), path);
}
}
private void fetchAndDeleteIca(string path)
{
// load properties individually
foreach (string line in System.IO.File.ReadAllLines(path))
{
if (line.Contains("[") || line.Contains("]") || line.Length == 0)
{
continue;
}
else
{
string property = line.Substring(0, line.IndexOf("="));
string value = line.Substring(line.IndexOf("=") + 1);
SetIcaProperty(property, value);
}
}
// delete the file
WriteMessage("Deleting ICA file...");
FlushEventLog();
File.Delete(path);
}
Your Citrix script would then make use of these methods as follows:
pollForIca(GetString("icaFilePath")); // this line blocks until the ICA file has been created by the Web VU
StartCitrixClient(1024, 768);
fetchAndDeleteIca(GetString("icaFilePath")); // once the ICA properties are loaded, the ICA file can be deleted
Connect();
StartTransaction("Connect To Citrix");
WaitForEvent(CitrixEventType.Connected);
EndTransaction("Connect To Citrix");