Referencing substitution parameters in custom actions
Custom action scripts can reference global, device and device agent substitution parameters, as shown in the following examples.
Example: Device agent substitution parameter
<customDeviceCommandDeclaration>
<name>Test Agent Parameters</name>
<guid>675B37D3-74B8-4C63-A713-550C260E394A</guid>
<browserExecutable>true</browserExecutable>
<inspectionOnly>true</inspectionOnly>
</customDeviceCommandDeclaration>
<deviceCommand>
<guid>675B37D3-74B8-4C63-A713-550C260E394A</guid>
<interaction>
<prompt>%prompt%</prompt>
<command>ping %agent.localhostAddress%</command>
<response>%prompt%</response>
<error>Invalid input</error>
</interaction>
</deviceCommand>
<name>Test Agent Parameters</name>
<guid>675B37D3-74B8-4C63-A713-550C260E394A</guid>
<browserExecutable>true</browserExecutable>
<inspectionOnly>true</inspectionOnly>
</customDeviceCommandDeclaration>
<deviceCommand>
<guid>675B37D3-74B8-4C63-A713-550C260E394A</guid>
<interaction>
<prompt>%prompt%</prompt>
<command>ping %agent.localhostAddress%</command>
<response>%prompt%</response>
<error>Invalid input</error>
</interaction>
</deviceCommand>
Example: Device substitution parameter
<customDeviceCommandDeclaration>
<name>Ping Device Host</name>
<guid>9C9AFD86-8780-4589-A90F-1F396400AD45</guid>
<browserExecutable>true</browserExecutable>
<inspectionOnly>true</inspectionOnly>
</customDeviceCommandDeclaration>
<deviceCommand>
<guid>9C9AFD86-8780-4589-A90F-1F396400AD45</guid> <!-- ping device host -->
<interaction>
<prompt>%prompt%</prompt>
<command>ping %device.host%</command>
<response>%prompt%</response>
<error>Invalid input</error>
</interaction>
</deviceCommand>
<name>Ping Device Host</name>
<guid>9C9AFD86-8780-4589-A90F-1F396400AD45</guid>
<browserExecutable>true</browserExecutable>
<inspectionOnly>true</inspectionOnly>
</customDeviceCommandDeclaration>
<deviceCommand>
<guid>9C9AFD86-8780-4589-A90F-1F396400AD45</guid> <!-- ping device host -->
<interaction>
<prompt>%prompt%</prompt>
<command>ping %device.host%</command>
<response>%prompt%</response>
<error>Invalid input</error>
</interaction>
</deviceCommand>
Example: Global substitution parameters
<customDeviceCommandDeclaration>
<name>Cooked up a command using GSP</name>
<guid>7C1D36C0-5F32-479B-8FD5-785A9EDE3A80</guid>
<browserExecutable>true</browserExecutable>
<inspectionOnly>true</inspectionOnly>
</customDeviceCommandDeclaration>
<deviceCommand>
<guid>7C1D36C0-5F32-479B-8FD5-785A9EDE3A80</guid>
<interaction>
<prompt>%prompt%</prompt>
<command>%global.myCommand% %global.myValue%</command>
<response>%prompt%</response>
<error>Invalid input</error>
</interaction>
</deviceCommand>
<name>Cooked up a command using GSP</name>
<guid>7C1D36C0-5F32-479B-8FD5-785A9EDE3A80</guid>
<browserExecutable>true</browserExecutable>
<inspectionOnly>true</inspectionOnly>
</customDeviceCommandDeclaration>
<deviceCommand>
<guid>7C1D36C0-5F32-479B-8FD5-785A9EDE3A80</guid>
<interaction>
<prompt>%prompt%</prompt>
<command>%global.myCommand% %global.myValue%</command>
<response>%prompt%</response>
<error>Invalid input</error>
</interaction>
</deviceCommand>
Related topic
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*