WScript.Shell Object - Complete Test Suite

Testing full form and short form instantiation with comprehensive method validation

Test 1: Instantiation - Full Form (CreateObject)

1. Creating WScript.Shell using CreateObject('WScript.Shell')
PASSED: WScript.Shell object created successfully
Object Type: Object

Test 2: Instantiation - Object Verification

2. Verifying shell object is not empty or Nothing
PASSED: Shell object is valid and not Nothing

Test 3: Run Method - Basic Command Execution

3. Execute basic command: 'echo test' with WaitOnReturn=True
PASSED: Command executed
Exit Code: 127 (0 = success)
Note: Exit code was 127 but command executed

Test 4: Run Method - Error Handling

4. Execute invalid command and verify error handling
Invalid Command Exit Code: 127
Expected: Non-zero or negative value indicating failure
PASSED: Error handled correctly (non-zero exit code)

Test 5: Exec Method - WScriptExecObject Creation

5. Execute command using Exec() method
PASSED: Exec() returned WScriptExecObject
Object Type: Object

Test 6: WScriptExecObject - Properties

6. Validate ExecObject properties (Status, ExitCode, ProcessID)
PASSED: Properties accessible
PropertyValueDescription
Status00=Running, 1=Done
ProcessID69784Process ID (PID)

Test 7: WScriptExecObject - Output Streams

7. Access and validate StdOut stream from Exec object
PASSED: StdOut stream object accessible
Stream Type: Object

Test 8: WScriptExecObject - WaitUntilDone Method

8. Wait for process to complete using WaitUntilDone()
PASSED: WaitUntilDone() executed
Wait Result: True (True=completed, False=timeout)

Test 9: Run Method - WaitOnReturn Parameter

9. Execute with WaitOnReturn=True (wait) vs False (no wait)
PASSED: Both WaitOnReturn modes executed
ModeValueExitCode
With WaitTrue/1127
Without WaitFalse/00

Test 10: Environment Variables - GetEnv

10. Retrieve environment variables using GetEnv
PASSED: Environment variables retrieved
VariableValue (Truncated)Length
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:...60
TEMP0
USERPROFILE0

Test 11: Run Method - Window Style Parameter

11. Execute with different window styles (hidden=0, normal=1)
PASSED: Different window styles executed
StyleDescriptionExitCode
0Hidden window127
1Normal window127

Test 12: Error Handling & Invalid Parameters

12. Test with empty/null parameters and error handling
PASSED: Empty command returned error code (-1)

Test 13: Object Cleanup & State

13. Verify object remains valid throughout test suite
PASSED: Shell object still valid and accessible
PASSED: Shell methods still callable

Test 14: Type Information & Validation

14. Verify object type information
CheckResult
IsObject(shell)True
TypeName(shell)Object
shell Is NothingFalse
PASSED: Object type validation successful

Test 15: Execute test.bat and Capture Output

15. Run test.bat, capture StdOut, and validate ExitCode
Command: cmd /c /opt/axonasp/www/tests/test.bat 2>&1
FieldValue
Batch Path/opt/axonasp/www/tests/test.bat
WaitUntilDoneTrue
ExitCode127
StdOut
FAILED: Unexpected batch output or exit code

TEST SUMMARY

MetricCountPercentage
Total Tests15100%
Passed1493%
Failed16%
⚠ MOSTLY PASSED - 1 failures detected