Grow your YouTube channel like a PRO with a free tool
Get Free YouTube Subscribers, Views and Likes

Cypress Testing Interview Questions| Postman Interview Questions For Experienced

Follow
RD Automation Learning

#postmaninterview #cypressinterview #apitesting
Which testing framework Cypress support?
Cypress support Mocha and Chai. It does not support TestNG or JUnit.

What are the advantages or benefits of Cypress?
Here are some benefits of Cypress:

Fast compare to Selenium
Time Travel Option: You can see the result of every step.
No sleep time required. Automatic wait is default in Cypress.
Debugging feature provide access to developer tools
Google for Angular Application
Less flaky, since directly execute on browser
It provides video capture option.

How to access shadow DOM in Cypress?
Shadow DOM allows hidden DOM trees to be attached to elements in the regular DOM tree. Shadow DOM is not a new thing by any means — browsers have used it for a long time to encapsulate the inner structure of an element. Use shadow() function to handle shadow dom:
cy.get('#locator').shadow().find('.nbbtn').click()
How can I get the first and last child of the selected element in Cypress?
In Cypress we have first() and last() functions for this. Example:
cy.get('#nbelement').first()
cy.get('#nbelement').last()


Launched the browser (Amazon website) and I need to verify its page title using Cypress so how will you do that
You can use cy.title() to get the title of the page and .should() to assert. For Example:

cy.title().should('eq','My Site Title')

List 5 cypress commands which can be used to interact with DOM elements?
type(): is used to type on element or text boxes.
clear(): is used to clear the fields or text boxes.
click(): is used to click on the element.
dblclick(): is used to double click on the element.
rightclick(): is used to right click on the element.

Could you describe the Cypress folder structures?
After you install Cypress it will create a recommended folder structure for you. Basically there are 4 major folders:

Fixture: This folder is used to store data objects or external pieces of static data that can be used throughout the tests. Usually, the data is stored in JSON format.
Integration: Next folder is integration, This is the main folder where you will keep you test. All your spec files will be here. Test file can be written as .js, .jsx, .coffee and .cjsx.
Plugins: It has own it's index.js file. Put here your custom plugins code.
Support: There are 2 files inside support folder: commands.js and index.js


How Cypress architecture is different from selenium?
In Selenium we have WebDriver present as a middle layer, which helps in Selenium command execution. But in the cypress, it directly operates inside the browser. So the browser executes the commands which we run as a script.
Any command you send using Selenium will be sent to specific browser driver like ChromeDriver, GeckoDriver etc and then driver will send command to browser.
Once you execute code in Cypress, The cypress directly sends the code to browser and click action gets executed.

What are the various authorization methods provided by Postman?
Postman provides the below API request Authorization Options:

API Key
Bearer Token
Basic auth
Digest auth
Oauth 1.0
Oauth 2.0
Hawk Authentication
AWS Signature
NTLM Authentication

What are the various variable scopes provided by Postman?
Postman has the following variable scopes:

Global Variables: Global variables allow data access between different collections, requests, and scripts. They are available throughout the workspace.
Environment Variables: These allow us to tailor the requests about different development environments such as local testing, stage testing, or prod testing.
Local Variables: These are temporary variables that are accessible only within the scope of requests scripts. They are either scoped to a single request or single collection, depending on the requirements. These variables are not available after the completion of the script execution.
Collection Variables: These variables are scoped to be available for all the requests present in a collection. They are independent of the environment.
Data Variables: These variables come from external JSON or CSV files for defining the datasets required to run the collection in Collection Runner or Newman

How will you stop the execution of upcoming requests or execution of the collections?
We can use the below code to stop the execution of the next request: pm.setNextRequest(null);

29. What do you understand by the prerequest script?
Prerequest scripts are those scripts that are used for executing Javascript code before a request is run. It is used for performing preprocessing tasks like setting variables, parameters, headers, body data, etc.

30. If we have a global and a local variable of the same name, which one will be given the most preference in Postman?
In such cases, the higher precedence is given to the local variable by overwriting the value of the global variable.

posted by bushati9p