Pass Multiple Headers in a Request using Rest Assured

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:20:01

9K+ Views

We can pass more than one header in a request in Rest Assured. A web service can accept headers as parameters while making a service call. The headers are represented in a key-value pair.There is more than one way of passing multiple headers in Rest Assured −Passing them in a key-value format using the header method.Syntax Response r = given() .baseUri("https://www.tutorialspoint.com/") .header("header1", "value1") .header("header2", "value2") .get("/about/about_careers.htm");Passing them as a Map using the headers method.Syntax Map m = new HashMap(); m.put("header1", "value1"); m.put("header2, "value2"); Response r = given() .baseUri("https://www.tutorialspoint.com/") .headers(m) .get("/about/about_careers.htm");Passing them as a List using the headers method.Syntax List h ... Read More

Manage Cookies in WebdriverIO

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:14:17

1K+ Views

We can manage cookies in WebdriverIO. A cookie helps to identify a user. It is an efficient technique to pass information from one site session to another or in between sessions of two connected websites.We can add, delete and obtain a cookie with WebdriverIO using the methods −browser.setCookies - this is used to set a single cookie or multiple cookies for the present page. To set a cookie for a page, we have to first launch and be on that page.Syntax browser.setCookies({cookie, cookie.name, cookie.value, cookie.path, cookie.domain, cookie.secure, cookie.httpOnly, cookie.expiry} )Here, a cookie is the cookie object or object array and ... Read More

Create TeamCity Report in Cypress

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:03:24

839 Views

We can create a teamcity report in Cypress. To install the package for teamcity report, run the command −   npm install cypress-teamcity-reporter --save-devTo generate a report for all specs in the integration folder of the Cypress project, run the command −   npx cypress run --reporter teamcity

Create a JUnit Report in Cypress

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:01:36

3K+ Views

We can create a Junit report in Cypress. To install the package for the JUnit report, run the command −   npm install cypress-junit-reporter --save-devExampleImplementation in cypress.json{ "reporter": "junit", "reporterOptions": { "mochaFile": "cypress/results/results.xml", "toConsole": true } }If we run multiple tests in a run and wish to have a unique report for individual spec files, we have to add [hash] in the mochaFile parameter in cypress.json.ExampleImplementation in cypress.json to avoid overriding report{ "reporter": "junit", ... Read More

Create Mochawesome Report in Cypress

Debomita Bhattacharjee
Updated on 19-Nov-2021 09:54:51

5K+ Views

We can create a Mochawesome report in Cypress. Cypress is bundled with Mocha, so any reports that can be generated for Mocha can also be utilized with Cypress.Mochawesome ReportThe Mochawesome report is one of the most important reports in Cypress. To install mochawesome, run the command −   npm install mochawesome --save-devTo install mocha, run the command −   npm install mocha --save-devTo merge mochawesome json reports, run the command −   npm install mochawesome-merge --save-devAll these packages after installation should get reflected on the package.json file.To merge multiple reports in a single report, run the command −   npm run combine-reportsIn the cypress.json ... Read More

Perform Data Driven Testing in Cypress

Debomita Bhattacharjee
Updated on 19-Nov-2021 09:49:45

385 Views

Cypress data-driven testing is achieved with the help of fixtures. Cypress fixtures are added to maintain and hold the test data for automation. The fixtures are kept inside the fixtures folder (example.json file) in the Cypress project. It basically helps us to get data input from external files.Cypress fixtures folder can have files in JSON or other formats and the data is maintained in "key:value" pairs. All these test data can be utilized by more than one test. All fixture data has to be declared within the before hook block.Syntaxcy.fixture(path of test data) cy.fixture(path of test data, encoding type ) ... Read More

Upload a File in Cypress

Debomita Bhattacharjee
Updated on 19-Nov-2021 09:44:28

6K+ Views

We can upload a file in Cypress. To perform the file upload task in Cypress, we have to first install a plugin with the command −npm ins tall –dev cypress-file-uploadOnce the installation is done, we have to add the statement import 'cypress-fileupload' in the command.js file which resides inside the support folder within our Cypress project. Also, we shall add the file that we want to upload within the fixtures folder(Picture.png file).To upload a file, we have to use the Cypress command, attachFile, and pass the path of the file to be uploaded as a parameter to it.ExampleImplementationdescribe('Tutorialspoint Test', function ... Read More

What is a Cypress Alias

Debomita Bhattacharjee
Updated on 19-Nov-2021 09:39:55

225 Views

Cypress aliases are an important component that has multiple uses. They are listed below −Sharing ContextWe have to use .as() to alias something that we have to share. To alias objects and primitives, Mocha context objects are used. The aliased object can be accessed with - this.*.Mocha by default shares context for all the hooks applicable for the test and the alias properties are flushed post the execution of a test.describe('element', () => {    beforeEach(() => {       cy.wrap('eleone').as('x')    })    context('subelement', () => {       beforeEach(() => {          cy.wrap('eletwo').as('y') ... Read More

MITM (Man-in-the-Middle) Attack Using ARP Poisoning

Ginni
Updated on 19-Nov-2021 07:25:04

579 Views

MITM stands for a man-in-the-middle attack. It is a cyber-attack where an attacker transmits and probably alters the connection between two parties who consider they are communicating precisely. This enables the attacker to transmit communication, investigate, and even change what each party is saying.In MITM, it can define a type of cyberattack where an intruder covertly taps transmissions connecting two entities to check or develop traffic therebetween. Malicious ones can use MitM attacks to seize passwords or multiple sensitive data, snoop on the prey, disrupt links, or distort content.Types of MITMThe types of MITM are as follows −Rogue Access PointDevices ... Read More

AODV Reactive Routing Protocol in MANETs

Ginni
Updated on 19-Nov-2021 07:23:18

3K+ Views

MANET stands for Mobile Ad-Hoc Network. It is an infrastructure-less collection of mobile nodes that can arbitrarily change their geographic locations such that these networks have dynamic topologies which are composed of bandwidth-constrained wireless links.MANET nodes are supplied with wireless transmitters and receivers. At a given time based on the nodes positions and their transmitter and receiver coverage designs and transmission power levels, wireless connectivity in the structure of a random, multi-hop graph or ad-hoc web exists between the nodes. The current applications of MANETs are in defense services, emergency search, and rescue services, meetings, and conventions, and other scenarios ... Read More

Advertisements