0

I am trying to use CMD task in azure build pipeline to execute the script which is stored in Azure Repo. When I run the build pipeline, cmd task throws below error:

 An error occurred: The file D:\a\1\s\_JmeterTest-AG\JmeterWebApp.jmx doesn't exist or can't be opened

I have checked JmeterWebApp.JMX does exists in my Azure Repo (JmeterTest-AG).

My CMD task details as follows:

**- task: CmdLine@2
  inputs:
      script: |
        echo 'Jmeter............'
        jmeter -n -t $(Build.SourcesDirectory)/_JmeterTest-AG/JmeterWebApp.jmx -l _JmeterTest-AG/Summary.jtl -e -o HTMLReports**```
3
  • Hi, Just checking in to see whether this issue is still blocking you now? Any update for this issue? Commented Apr 23, 2021 at 9:16
  • Hi, How about the issue? Does the answer below resolve your question? If yes, you could Accept it as an Answer , so it could help other community members who get the same issues and we could archive this thread, thanks. Commented Apr 26, 2021 at 14:43
  • 1
    Hi, Can you please give me some time to work on this as I have been busy with other stuff. Will update you by Next Monday Commented Apr 29, 2021 at 1:17

1 Answer 1

1

Repo directory structure

enter image description here

Power shell script:

trigger:
- master

pool:
  vmImage: ubuntu-latest

steps:
- task: CmdLine@2
  inputs:
    script: |
      echo 'Jmeter............'
      jmeter -n -t $(Build.SourcesDirectory)/_JmeterTest-AG/JmeterWebApp.jmx -l _JmeterTest-AG/Summary.jtl -e -o HTMLReports**```

Note: Then path $(Build.SourcesDirectory) is D:\a\1\s, we need to ensure that the folder _JmeterTest-AG is at the root path and it contain the file JmeterWebApp.jmx, then we will not see the error message.

In addition, we need to ensure that the file can open and run successfully, you can create the same file on your local machine and run the cmd.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.