×
Clear all filters including search bar
Valeri Tandilashvili's Personal Professional Blog
status exists in the response JSONpm.test('Has "status" property', function() {
var jsonData = pm.response.json();
pm.expect(jsonData).to.have.property('status');
});
The response JSON{
"status": {
"code": 400,
"text": "Mobile Number is required"
}
}status code is equal to 400 pm.test("Status code is 400", function () {
pm.response.to.have.status(400);
});text exists in the response JSONpm.test("status text key exists", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.status.text !== undefined).to.eql(true);
});
The response JSON{
"status": {
"code": 400,
"text": "Mobile Number is required"
}
}code key is equal to 400 pm.test("status code is equal to invalid HTTP request", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.status.code).to.eql(400);
});
The response JSON{
"status": {
"code": 400,
"text": "Mobile Number is required"
}
}allowedMilliseconds with value 100 pm.environment.set("allowedMilliseconds", 100);
Get the environment variablepm.environment.get("allowedMilliseconds")
The environment variable in real use case. In this example response time is checked to be below 100mspm.test("Response time is less than "+pm.environment.get("allowedMilliseconds")+"ms", function () {
pm.expect(pm.response.responseTime).to.be.below(pm.environment.get("allowedMilliseconds"));
});allowedMilliseconds with value 100 pm.global.set("allowedMilliseconds", 100);
Get the global variablepm.global.get("allowedMilliseconds")
The global variable in real use case. In this example response time is checked to be below 100mspm.test("Response time is less than "+pm.global.get("allowedMilliseconds")+"ms", function () {
pm.expect(pm.response.responseTime).to.be.below(pm.global.get("allowedMilliseconds"));
});this means the object being clicked<a class="view_all" onclick="consoleLogMe(this);" href="javascript:">object being clicked</a>
this means the global object window in this example:<a class="view_all" href="javascript:alertMe(this)">window object</a> JS is to use !! directives:<script>
change_asset_category('{!! $category_values !!}');
</script>The result will be:<script>
change_asset_category('{"version":"vers","patch_level":"patc","bcp_dr":"bcp\/d"}');
</script>UTF-8 - 8-bits are used to represent a character
2. UTF-16 - 16-bits are used to represent a character
...
UTF stands for UCS Transformation Format, and UCS itself means Universal Character Set
...
XML document example that has UTF-8 encoding<?xml version="1.0" encoding="UTF-8"?>
<student>
<first-name>George</first-name>
<phone.mobile>(011) 123-4567</phone.mobile>
</student>
Note: If an XML document has not specified encoding, the default is UTF-8<?php
$my_xml_data =
'<?xml version="1.0" encoding="UTF-8"?>
<student>
<?sort alpha-ascending?>
<?textinfo whitespace is allowed ?>
<first-name>George</first-name>
<phone.mobile>(011) 123-4567</phone.mobile>
</student>';
$xml = simplexml_load_string($my_xml_data);
$doc = dom_import_simplexml($xml)->ownerDocument;
$xpath = new DOMXPath($doc);
# prints "/* processing instructions */ ", the value of the first PI: textinfo
echo $xpath->evaluate('string(//processing-instruction("textinfo")[1])');
The output of the above code is the following:whitespace is allowed