2

I am relatively new to SFDX and have the most recent updates for both VSCode and Salesforce CLI.

I am unable to run any Apex tests on a sandbox using the UI in Visual Studio Code. When doing so I get the following output

sfdx force:apex:test:run --tests Plan_XXXX_ControllerExt_Test.testxxxxController --resultformat human --outputdir c:\Users\xxxxxx\Documents\xxx\xxxxx\.sfdx\tools\testresults\apex --loglevel error ERROR: Unable to invoke async test job: Cannot read property '1' of null.

When running that directly from the CLI I get the following

WARNING: In salesforcedx v41 and earlier, the --resultformat parameter caused the apex:test:run command to wait for test results rather than finishing immediately and returning a test run ID. In salesforcedx v42 and later, the --resultformat parameter will no longer cause the command to wait. To wait for test results, include the --wait parameter. ERROR: Unable to invoke async test job: Cannot read property '1' of null.

However, if I run the tests without the --resultformat tag through the CLI I am able to get back test results.

e.g. -

sfdx force:apex:test:run --tests Plan_XXXXX_ControllerExt_Test.testxxxxController --outputdir c:\Users\xxxxxx\Documents\xxx\xxxxx\.sfdx\tools\testresults\apex

1

This issue was resolved by changing the proxy settings in Windows environment variables.

Previous

HTTP_PROXY = http://username.password@company.proxy.com:8080

HTTPS_PROXY = http://username.password@company.proxy.com:8080

FIX

HTTP_PROXY = http://company.proxy.com:8080

HTTPS_PROXY = http://company.proxy.com:8080

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.