Hello everyone,
I have seen in this page: https://www.ranorex.com/help/latest/int ... -pipeline/, I have found Ranorex can connect with pipelines.
Can Ranorex connect with 'Test Plans'? I hope Ranorex can after testing the test results automatically send to Azure Devops. Is it possible?
Best regards
Rika
Can Ranorex connect to 'Test plans' of Azure Devops ??
Re: Can Ranorex connect to 'Test plans' of Azure Devops ??
Hi Rika,
If you want to attach a rxzlog to test runs summary, then I'm afraid, it's not an easy task and definitely not done automatically You need to create a PowerShell script, which does what you want. I'm using something like this (you must have personal access token)...
The result of above code should look like this:
If you want to attach a rxzlog to test runs summary, then I'm afraid, it's not an easy task and definitely not done automatically You need to create a PowerShell script, which does what you want. I'm using something like this (you must have personal access token)...
Code: Select all
- task: PowerShell@2
displayName: Attach Ranorex report to test summary
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
continueOnError: true
targetType: 'inline'
script: |
#$AzureDevOpsPAT = "YourPersonalAccessToken"
#$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($AzureDevOpsPAT)"))}
$AzureDevOpsAuthenicationHeader = @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"}
# Build Id
Write-Host "buildID: $(Build.BuildId)"
$url = 'https://PathToYourAzureProject/_apis/test/ResultDetailsByBuild?buildId=$(Build.BuildId)'
$response = Invoke-RestMethod -Uri $url -Headers $AzureDevOpsAuthenicationHeader -Method Get
Write-Host "response = $($response)"
# get test run Id
$testRunId = $($response.resultsForGroup.results[0].testRun.id)
Write-host "test run number = $($testRunId)"
# convert file to base64 string
$base64string = [System.Convert]::ToBase64String([IO.File]::ReadAllBytes("$(System.DefaultWorkingDirectory)\Reports\$(rxzlogFile)"))
Write-host "Converted string = $($base64string)"
# create request body
$BuildReqBody= @{stream=$base64string;fileName="$(rxzlogFile)";comment="Ranorex report";attachmentType="GeneralAttachment"}
$BuildReqBodyJson = $BuildReqBody | ConvertTo-Json -Compress
# attach report to test run
$htmlReportFile = Invoke-RestMethod -Uri "https://PathToYourAzureProject/_apis/test/Runs/$testRunId/attachments?api-version=6.0-preview.1" -Method Post -ContentType 'application/json' -Body $BuildReqBodyJson -Headers $AzureDevOpsAuthenicationHeader
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 2
- Joined: Sun Apr 02, 2023 7:06 pm
Re: Can Ranorex connect to 'Test plans' of Azure Devops ??
Can we update the test passing/failing results to each test case inside a test plan in Azure?