POSTMAN-NEWMAN: 403 Forbidden error message - api

1) Newman Version (can be found via newman -v): version is 4.6
2) OS details (type, version, and architecture): RHEL 7.4
3) Are you using Newman as a library, or via the CLI? Downloaded Newman via npm
4) Did you encounter this recently, or has this bug always been there: We are executing our postman collections through newman in Jenkins for the first time.
5) Expected behaviour: status 200
6) Command / script used to run Newman: HTTP_PROXY=http://xx.xx.xx.xx:xx HTTPS_PROXY=http://xx.xx.xx.xx:xx newman run collections.json --reporters junit,html,xml
We are trying to automate the execution of API test collections using Newman in Jenkins. The collections are executing properly in postman, but we are getting 403 forbidden when we execute them in Jenkins. We are getting outputs like these:
GET http://xx.xx.xxx.xx:xxxx/api/add-lead/ [403 Forbidden, 2.69KB, 133ms]
There was an error running your collection: tunneling socket couldn't be established, statusCode=403
We have installed Jenkins and necessary capabilities to execute postman collections in a Jenkins agent. Jenkins, agent, the IPs mentioned in GET, PUT commands are in our bank's internal network.
What could be the reason because we have scanned through similar issues, but found no satisfactory answers.
Please tell me if you need any other details.
Regards

Related

Unable to run testcafe tests on CI/CD gitlab but works fine locally on the runner

I am seeing an issue running testcafe tests on the gitlab runner. The tests runs fine locally on the gitlab runner, but when run off the CI/CD pipeline it fails. Below is my .yaml code -
test-e2e-windows:
stage: test
cache:
<<: *global_cache
policy: pull
#needs: ['yarn-install']
tags:
- win32
script:
- yarn install
- yarn run test:e2e
Below is the error I see -
$ yarn run test:e2e
Running tests in:
Chrome 99.0.4844.82 / Windows 10
Audio Configuration Combination
× Inbuilt_Mic_Recording_1Ch_48 khz_16 bit_64 kbps_opus_webm
A JavaScript error occurred on
"https://dolby-web-sdk-dev.net/sandbox/index.html".
Repeat test actions in the browser and check the console for errors.
To ignore client-side JavaScript errors, enable the
"--skip-js-errors" CLI option, or set the "skipJsErrors"
configuration file property to "true".
If the website only throws this error when you test it with
TestCafe, please create a new issue at:
"https://github.com/DevExpress/testcafe/issues/new?template=bug-report.md".
JavaScript error details:
NotFoundError: Requested device not found
No stack trace available
Am I missing something here?
According to the "Requested device not found" error message, this issue is related to your application implementation:
DOMException: Requested device not found GetUserMedia.
Requested device not found - Unable to access Camera and Microphone
I can assume that it tries to access some device on a virtual machine but fails due to the fact that this device does not exist. In my opinion, the best way to resolve this issue is to manually handle this error in your application.
If my assumptions are wrong, please create a new GitHub issue using this template and share a minimal working example illustrating the issue.

Selenium Tests running locally but failing on Azure DevOps Pipeline

I'm kind new to the DevOps world, and I'm having an issue where my test team can run their tests locally however some of them are failing when using a Pipeline.
The tests that are failing are upload files ones, however this only happens on a specific webpage of our solution.
Any idea of what can be happening?
Pipeline Steps:
We are using an Azure Agent (windows 2019)
1 - We install Google chrome webdrive (its then configured on the code)
2 - We run the following Maven script
mvn clean verify -P $(MavenProfiles) -e -Dcucumber.options="--tags $(Tags)" -
Dheadless=$(headless) -Denv=$(Environment) -Dlog4j.configurationFile=src/log4j2.xml
This is the error the the test throws:
java.lang.IllegalStateException: WebElement 'By.cssSelector: [id='Client_Name']' was not found on page. Exception: org.openqa.selenium.TimeoutException: Expected condition failed: waiting for ui.controllers.GlobalUtilities$1#29a33620 (tried for 16 second(s) with 2000 milliseconds interval)
I noticed this error all through the pipeline logs, however only fail on specific tests.

Jenkins plugin Klocwork : Error occurred during build: Authentication failed

I'm running Klocwork analysis with Jenkins on a windows server 2019.
Jenkins : 2.235.1
Klocwork Analysis Plug-in : 2020.3.
when the job is executing klockwork command (kwbuildproject, kwdeploy), there is authentication error :
Authentication failed. Please run the "C:\Klocwork\Server 18.2\bin\kwauth.exe --url https://<my-URL>/" command to login.
Of course, I ran kwauth.exe, and the klockwork commands run fine from command line on server.
The problem is that when run by the plugin, the authentication fails (or no credential provided - it's not visible in log)
I tried to use explicit ltoken configuration, and it's detected by the plugin
Detected ltoken file. Setting KLOCWORK_LTOKEN to "C:\Users\<my-USER>\.klocwork\ltoken"
But still, same authentication error.
On an older Jenkins (Plugin Klocwork Analysis 1.18), the authentication works using same ltoken file.
Do I miss something in the configuration of Klocwork plugin ?
Are you running the Klocwork analysis from the command line as X user and trying to run the Jenkins Job as Y user? if yes, you should authenticate the Y user as well through kwauth. Y user should have access to perform Klocwork analysis (Roles).
Please Make sure the ltoken file can be accessed by Jenkins.

Failed to integrate Bugzilla Testopia with Jenkins with the aid of Testopia Plugin - cannot execute any iterative build step

I’m trying to integrate Bugzilla Testopia with Jenkins with the aid of the Testopia Plugin for Jenkins.
The general configuration is probably fine as the connection between Testopia and Jenkins is well established (Jenkins log says: ‘Connecting to Testopia to retrieve automated test cases’ and no error occurs then). However I’m unable to retrieve any information concerning Test Runs/Test Cases etc. from Testopia.
Moreover I cannot perform any of ‘Iterative Test Build Steps’. If I want to ‘Execute Shell’ in ‘Iterative Test Build Steps’ with Testopia Plugin no operation is carried out (even if I try: echo 12345 etc.). If I use ‘Single Test Build Steps‘ then shell command is executed.
My goal is to retrieve test class name from Testopia (it is stored in Testopia Test Case’s field - Automation/Scripts ) and then run maven build from Jenkins with this class name set as the parameter. Afterwards depending on the Jenkins build success or failure status I’d like to update the Test Case Status in Testopia.
How to fetch any information from Testopia into Jenkins?
Why any of ‘Iterative Test Build Steps’ is not executed?
Any clues? - Testopia Plugin site example wasn't too helpful for me.
Both Bugzilla and Jenkins are hosted on the same Ubuntu 14.04. I've got the latest stable versions of Jenkins, Bugzilla and Testopia.
Thanks in advance,
M.
EDIT:
Well this debugging does not work for me. I added a new log recorder with the 'ALL' level chosen and I cannot see any additional log neither in job's console output nor in the newly created logger output.
Maybe sth is wrong with my Testopia installation? Some more details concerning my configuration:
I've got Testopia installed on the same machine (as Jenkins) and usually I access it through: http://'ip_address'/bugzilla
- in Testopia plugin configuration my URL to Testopia installation is: http://'ip_address'/bugzilla/xmlrpc.cgi
- I've got only one bugzilla account - these admin's credentials I use in Jenkins
- sometimes in Jenkins I can see a warning concerning improper reverse proxy configuraiton - maybe it has sth to do with the problem
After job execution all Testopia's fields are 0 - Run Id, Build Id etc. - which obviously indicates that no information was successfully retrieved from Testopia.
Any ideas how to check why I cannot retrieve any information from Testopia?
EDIT 2:
In the meantime I think I've found a clue in the jenkins.log file in jenkins installation directory:
Exceptions like these occur:
INFO: TESTOPIA_TEST_SUITE_3 #13 main build action completed: SUCCESS
org.apache.xmlrpc.XmlRpcException: The requested method 'TestRun.get' was not found.
at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197)
...
org.apache.xmlrpc.XmlRpcException: The requested method 'TestRun.get_test_cases' was not found.
at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197)
Shall I insert the full stacktrace?
It looks like that plugin logs a fair amount of information, though not all of it to the build console output itself.
To debug further, you could try adding a new log recorder for the logger jenkins.plugins.testopia (with log level "all"), run a build, then refresh the web page for the newly-created log recorder to see the output.
You should at least see "Filtering for automated test cases" after connection, information about each test case found, and then log output for each iterative build step as it's run on each test case.
I got the similiar problem when I use python xmlrpc to commnicate with my bugzilla-testopia server.
I chekc the error code and find XMLRPC.pm under my bugzilla install location : "./WebService/Server/XMLRPC.pm".
I know the error was thrown by this sub function, which checks login status and forward to modules where the moduel.function must be in PUBLIC_METHODS:
sub handle_login {
...
if (none { $_ eq $method } $class->PUBLIC_METHODS) {
ThrowCodeError('unknown_method', { method => $full_method });
}
...
}
I don't know why but TestCase.get could not be found in PUBLIC_METHODS, so I just marked them as comment and then it works. You can do this quick way to make sure your client setting is correct. Then you should solve the "PUBLIC_METHODS" problem next.

Playframework test-runner selenium permission denied Location.href and Command Execution Failure

This test works locally, but when run from the Play test runner on our aws ci instance, I get the following permissions error in Firefox: Permission denied for HOST to get property Location.href and then Command execution error.
In Chrome, the remote message is different, but I sense the same underlying reason. Object <> has no method 'getCurrentWindow'.
Is it this issue? http://code.google.com/p/selenium/issues/detail?id=703
you are using the Play standard test runner from a remote location, which is the source of the issue (as far as I know).
Try to use play auto-test as described here to run the tests.