0% found this document useful (0 votes)
20 views3 pages

QA Automation Tester Interview Questions and Answers

The document contains a comprehensive list of interview questions and answers for QA Automation Tester roles, covering topics such as Selenium WebDriver, APIs, Postman, Git, and TestNG. Key concepts include various locators in Selenium, HTTP request components, API testing differences, and Git commit processes. It also addresses practical scenarios like handling browser notifications, validating API responses, and managing test execution in TestNG.

Uploaded by

Marlon Cabraca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views3 pages

QA Automation Tester Interview Questions and Answers

The document contains a comprehensive list of interview questions and answers for QA Automation Tester roles, covering topics such as Selenium WebDriver, APIs, Postman, Git, and TestNG. Key concepts include various locators in Selenium, HTTP request components, API testing differences, and Git commit processes. It also addresses practical scenarios like handling browser notifications, validating API responses, and managing test execution in TestNG.

Uploaded by

Marlon Cabraca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

QA Automation Tester Interview Questions & Answers

Selenium WebDriver
Q: What are different types of locators in Selenium?
A: ID, Name, Class Name, Tag Name, Link Text, Partial Link Text, CSS Selector, XPath.

Q: When do you use Xpath over CSS locators?


A: Use XPath when elements are not easily selectable by CSS, or when navigating DOM
hierarchies.

Q: How to get a specific value from a dropdown and reuse it in verifications?


A: Use Select class to get the selected option: `select.getFirstSelectedOption().getText()` and store
it in a variable.

Q: When do we use JavaScript Executors?


A: When WebDriver methods are not sufficient, like clicking hidden elements or scrolling.

Q: Is it possible to validate Captcha using Selenium? If yes, how?


A: Generally no. Captchas are designed to prevent automation. Use mocks or disable in test
environments.

Q: What should be the ideal way to store data using Selenium WebDriver only?
A: Use data structures like HashMaps in the test code or external files (e.g., Excel, JSON).

Q: Is it possible to use Xpath like parent/child/node/.. ? If yes, provide an example where to use it?
A: Yes. Example: `//div[@id='parent']/child::span` or `..` to move up a node.

Q: What happens if you receive browser notifications during test automation execution?
A: They can interfere. Handle them using browser profile settings to disable.

Q: Why does Stale Element Exception occur, and how to handle it?
A: Occurs when the DOM changes. Use try-catch and re-locate the element.

Q: What is Invalid Certificate Exception?


A: It occurs when the browser detects a security certificate issue. Use browser capabilities to ignore.

APIs
Q: What are the components of an HTTP request?
A: Method, URL, Headers, Body.

Q: What is the difference between API and unit testing?


A: API testing tests interfaces between systems. Unit testing tests individual code units.
Q: What is an HTTP response?
A: It's what the server returns, including status code, headers, and body.

Q: How can we add validation points in Postman?


A: Using test scripts in the 'Tests' tab with JavaScript.

Q: What do you understand by server-side validation?


A: Validation performed on the server to ensure data integrity and security.

Q: What is 3-tier architecture?


A: Presentation layer, Logic layer, and Data layer.

Q: What is the difference between web services and APIs?


A: Web services are a type of API accessible over a network. APIs are a broader category.

Q: What is REST, SOAP, and GraphQL in APIs?


A: REST: stateless, HTTP-based. SOAP: protocol with strict rules. GraphQL: query-based.

Q: What do you test in standalone APIs?


A: Functionality, response time, error handling, validation.

Q: What do you test in 3rd-party integrated APIs?


A: Auth, reliability, contract compliance, response formats.

Postman
Q: When to use collections, environments, and global variables?
A: Collections group requests. Environments store variables. Globals are available across
collections.

Q: How to execute a collection end-to-end?


A: Use Collection Runner or Newman for command-line execution.

Q: How to validate that an API response has the correct status code?
A: In 'Tests' tab: `pm.response.to.have.status(200)`

Q: What happens when an API response returns Form Data instead of JSON, and how to validate
it?
A: Parse it manually or use text checks if JSON is not returned.

Q: How to set up Basic Auth in Postman?


A: In 'Authorization' tab, choose Basic Auth and input credentials.

Q: Where do you store environment credentials?


A: In Environment variables or encrypted vaults, never in code.
Q: How to save a demo response for an API request?
A: Click 'Save Response' after getting the response.

Q: How will you validate an API request if VPN is required for it to work?
A: Ensure VPN is active before sending the request.

Q: How do you filter results in an API request using Postman?


A: Add query parameters or use filtering keys in the body.

Q: How to set up custom headers in Postman?


A: Use the 'Headers' tab and add key-value pairs.

Git
Q: What are the different stages in committing the code to GitHub?
A: Working Directory -> Staging Area -> Local Repository -> Remote Repository.

Q: Is it possible to revert changes in a remote repository? If yes, how?


A: Yes, use `git revert`, `git reset`, or a new commit to undo.

Q: When do you commit your code? After committing, how do you validate that everyone has the
updated code?
A: Commit after testing. Use `git pull` and `git status` to sync.

Q: How to merge stashed changes in a local repository?


A: `git stash pop` or `git stash apply stash@{n}`

Q: Why do we need a `.gitignore` file? How do you add files to it?


A: To exclude files from being tracked. Add patterns to `.gitignore`.

TestNG
Q: What is the execution format of tests in TestNG?
A: Alphabetically or by priority/annotations in XML/test class.

Q: Can priority be negative for methods? If yes, what is the execution flow as per priority?
A: Yes. Lower (even negative) priority runs first.

Q: What is the difference between `dependsOnMethods` and `dependsOnGroups`?


A: `dependsOnMethods` links individual tests. `dependsOnGroups` links test groups.

Q: What are the different ways to exclude tests in TestNG?


A: Use `enabled=false`, XML exclusions, or groups.

Q: What does `threadPoolSize` mean in TestNG, and how does it work?


A: Defines number of threads to run tests in parallel for one test method.

You might also like