
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
testx-http-keywords
Advanced tools
Keywords to send simple http requests and check the responses using the testx library.
A library that extends testx with keywords for sending basic http requests. This library is packaged as a npm package
From the directory of the art code install the package as follows:
npm install testx-http-keywords --save
After installing the package add the keywords to your protractor config file as follows:
testx.keywords.add(require('testx-http-keywords'))
| Keyword | Argument name | Argument value | Description | Supports repeating arguments | 
|---|---|---|---|---|
| send http [optional request method] request | send a http POST request and check if the response status code is 200 | |||
| url | relative url to which the request will be sent | No | ||
| method | request method | Optional. Valid values are get, post, put, delete, patch and head. Defaults to get. It is also possible to put the method in the keyword, as in send http post request or send http delete request instead of providing this argument. | No | |
| json | a valid JSON string that contains the body of the request, will make the Content-Type of the request 'application/json' | Optional. Cannot use it together with body. | No | |
| body | a string that contains the body of the request | Optional. Cannot use it together with json. | No | |
| headers | custom headers | Optional. Semicolon or new line-separated string of '='-separated key-value pairs. For example "User-Agent=testx;Something-Else='value with spaces'" | No | |
| expected status code | expected status code of the response | Optional. The test will fail if the actual status code is different; defaults to 200 | No | |
| expected response | expected content of the response | Optional. The test will fail if the actual content (body) of the response is not equal. | No | |
| expected response regex | a regex to match against the response | Optional. The keyword will try to match the provided regular expression against the content (body) of the response and will fail if there is no match; currently it is not possible to provide regex matching options. | No | |
| expected headers | list of expected response headers | Optional. Same format as the headers parameter. The keyword will fail if not all of the expected response headers exist or if they have values different than the expected/specified onesble to provide regex matching options. | No | |
| json path/xpath | expected value at this json path or xpath | Optional. Depending on the Content-Type header this argument will be treated as JSON path or an XPath. The argument name should be the actual path, i.e. "$.address.city" or "//address/city". | Yes | |
| expected missing json paths | list of expected missing json paths | Optional. The keyword will fail if one of the expected response headers exist | No | |
| expected present json paths | list of expected present json paths | Optional. The keyword will fail if one of the expected response headers does not exist | No | 
FAQs
Keywords to send simple http requests and check the responses using the testx library.
We found that testx-http-keywords demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.