🤓 technical interview prep

Ace your homework & exams now with Quizwiz!

Symbol for 'AND' operator

&&

What is a foreign key?

- A column or set of columns in a table that establishes a link between two tables. - It represents a relationship between the data in the foreign key column and the primary key column of another table.

What is a subquery?

- A query nested within another query. It allows you to perform queries that depend on the results of another query. - They can be used in SELECT, INSERT, UPDATE, and DELETE statements and can return a single value, a single row, multiple rows, or an entire result set.

What are the steps to calculate test automation coverage?

- Identify what needs to be tested, like features or code. - Then see how much of that testing is done automatically with our automated tests. - Then we calculate by: multiplying the ratio of automated test cases to the total test cases x 100.

API Testing Tools

- Postman: API development tool that allows users to design, test, and debug APIs. - Rest Assured: Java library used for API automation testing, particularly for RESTful APIs.

What is Maven?

A project management tool for Java. It handles dependency management, project builds, and automates tasks, making development smoother and more efficient.

Hard Assertion

A statement that checks whether a specific condition is true at a particular point in the test case. If it fails during test execution, it immediately stops the test execution and marks the test as failed. They are typically used when the failure of a single assertion invalidates the entire test case, and proceeding further would not make sense. Examples: assertEquals, assertTrue, and assertNotNull.

Why use Postman and Rest Assured together in API Testing?

By combining both tools, we can efficiently cover a wide range of test scenarios, from exploratory testing to automated regression testing, ensuring the quality and reliability of our APIs. - Postman is great for quick manual testing and exploring APIs interactively, which is handy during development or when debugging. - On the other hand, Rest Assured allows for automated testing with code, offering greater control and flexibility for creating comprehensive test suites.

How to Write Test Scenarios

Craft concise and focused feature files in Gherkin syntax to cover different functionalities of the application.

How do you start your Automation?

I start by analyzing the project requirements and identifying test scenarios. Then, I select appropriate automation tools and frameworks based on project needs. After setting up the automation environment, I create test scripts for critical scenarios, focusing on functionality, reliability, and maintainability. Finally, I integrate automation into the CI/CD pipeline for continuous testing and feedback.

Where do you get API endpoints?

I typically obtain endpoints from the API documentation provided by the developers. This documentation outlines the various endpoints available, along with their functionalities and parameters. Also, I may collaborate with the development team or refer to any internal resources that document the API endpoints. Once I have access to this information, I can effectively utilize the endpoints for testing purposes.

How do you write your X-Paths?

I write XPaths by focusing on unique attributes, avoiding fragile paths, keeping them concise, using relative paths, minimizing indexes, considering accessibility, thoroughly testing them, and refactor them periodically for maintainability.

How would you open a child window using Selenium? (Get to another tab)

I'd identify the action that triggers the opening of the child window, such as clicking a link or button. After the new window opens, I would use the getWindowHandles() method to collect all available window handles. Then, I would iterate through the window handles to find the handle of the child window. Once identified, I would use the switchTo().window() method to switch to the child window. This will allow me to perform actions specific to the child window, such as retrieving its current URL or interacting with elements. After completing the tasks in the child window, if necessary, I would switch back to the parent window using similar steps.

In Selenium WebDriver, what are the 8 web locators supported?

ID: Locating elements by their unique HTML 'id' attribute. Name: Using the 'name' attribute of an element to locate it. XPath: Employing XPath expressions to locate elements based on their position or attributes. CSS Selector: Utilizing CSS selectors to locate elements, which can be more efficient in some cases. Class Name: Finding elements by their CSS class names. Tag Name Locator: Locating elements by their HTML tag name (e.g., 'div', 'a', 'input'). Link Text Locator: Identifying links by their visible text. Partial Link Text Locator: Locating links by matching a part of their visible text.

What happens when a class extends another class?

It inherits the properties and behaviors (methods and fields) of the superclass.

What is groupid and artifactid in the POM or in the Project?

It uniquely identifies the project and help Maven manage it effectively.

What is Mock Testing?

It's a technique where we can simulate the behavior of certain components or dependencies within our system. We create mock objects to mimic real objects or services, allowing us to test our code in isolation without relying on external dependencies. It's useful for unit testing, integration testing, and performance testing, helping ensure our code behaves as expected in different scenarios.

What are RESTful APIs?

It's a type of web service architecture designed for building scalable and lightweight applications. They use standard HTTP methods to interact with resources identified by unique URLs, following principles like resource-based addressing, statelessness, and a uniform interface. This approach enables efficient communication between clients and servers, making it easier to develop and consume APIs in modern web applications.

What format do many APIs return data in?

JSON format.

Constructors

Methods used for initializing objects.

Can one class inherit multiple classes?

No, it can only inherit from one class at a time, but Java does let you implement multiple interfaces if you need to inherit from more than one source.

What is the heart of Maven projects?

POM.xml file

What is the difference between Static Binding and Dynamic Binding?

Static Binding: - Happens at compile time. - Occurs when the method call is resolved based on the type of the reference variable. - AKA early binding. - Used in method overloading. ✨ Static binding is when the compiler knows which method to call at compile time. Dynamic Binding: - Happens at runtime. - Occurs when the method call is resolved based on the type of the object the reference variable is pointing to. - AKA late binding or runtime polymorphism. - Used in method overriding. ✨ Dynamic binding is when the decision about which method to call is made at runtime, depending on the type of the object.

SUPER [S U P]

Superclass or parent class. Uses super to access superclass methods and constructors. Points to the parent class.

There is one dropdown and I want to select one value from the dropdown, what are the different methods in selenium to do so? How many methods are there?

There are four common methods to select a value from a dropdown in Selenium WebDriver: by visible text, by value, by index, and using send keys but it depends on the specific characteristics of the dropdown and the requirements of your test scenario. dropdown.selectByVisibleText("Option 1"); dropdown.selectByValue("value1"); dropdown.selectByIndex(0); dropdown.sendKeys("Option 1");

What command is used to stop Java execution?

There isn't one specific command in Java but there are a few methods depending on the program's requirements and design. - System.exit(int status) method: It terminates the currently running Java Virtual Machine and shuts down the program. - Exception Handling: You can throw an exception (e.g., RuntimeException) to stop the execution when an error occurs. - Exiting Main Method

What are Static Methods?

They are methods that belong to the class itself and can be called directly using the class name. They're useful for utility functions and operations that don't rely on specific object states. Unlike instance methods, static methods cannot directly access instance variables or methods of the class.

Can List take duplicated values?

Yes. For example, you can use ArrayList to store data which allows you to include the same value multiple times in the list.

How do you use Docker?

• Docker allows for me to create isolated testing environments that closely mimic production, making it easier to test applications in a controlled and consistent environment. • I use Docker to spin up testing environments quickly, run automated tests in parallel, and ensure that the tests are running against the same environment every time. • Also, Docker integrates seamlessly with CI/CD pipelines, allowing us to automate the testing and deployment process, identify and fix issues earlier in the development cycle, and deliver high-quality software more efficiently.

X-Path

• Preferred when elements don't have easily identifiable attributes. • Useful for traversing complex or nested structures. • Provides more flexibility in locating elements, such as finding elements based on their text content, position relative to other elements, or traversing up and down the DOM tree. • Can be slower compared to CSS selectors, especially in older browsers.

What is a primary key?

- A unique identifier for each record in a table. It ensures that each row in the table is uniquely identifiable and serves as a reference point for establishing relationships between tables. - A primary key column cannot contain NULL values, and there can be only one primary key column in a table.

Single Slash (/): XPath

- AKA the "child axis" and is used to select the immediate child elements of the current node. - It specifies a direct path from the current node to the child node. - For example, /parent/child selects the child elements that are direct children of the parent element.

Double Slash (//): XPath

- AKA the "descendant-or-self axis" and is used to select all descendants (children, grandchildren, etc.) of the current node, regardless of their depth in the hierarchy. - It specifies a path from the current node to all descendants matching the specified criteria. For example, //child selects all child elements in the document, regardless of their level of nesting.

AWS IoT

- AWS IoT (Amazon Web Services Internet of Things) is a platform provided by Amazon for managing IoT devices and data. - It offers services for device provisioning, device management, data ingestion, and analytics. - AWS IoT supports integration with other AWS services such as Lambda, S3, DynamoDB, and IoT Core.

Do you use Git and Github and how do you resolve conflict?

- After identifying the conflicting changes, I manually edit the conflicted sections. Then, decide which changes to keep, modify, or discard. - Remove the conflict markers (<<<<<<<, =======, >>>>>>>) once conflict is resolved. - After resolving the conflict, stage the modified files using 'git add'. - Once all conflicts are resolved, commit the changes using 'git commit'. - If resolving conflicts during a merge, complete the merge using 'git merge --continue'. - Push changes to remote repository using 'git push'.

What is POM.xml?

- An XML file that serves as the backbone of Maven's configuration. - It contains crucial information about the project, including its dependencies, build settings, plugins, and more. Essentially, it acts as a blueprint that Maven follows to manage the project effectively.

What is Selenium?

- An open-source tool for automating web browsers. - It is primarily used for testing web applications by simulating user interactions such as clicking buttons, entering text, and navigating through pages. - Supports various programming languages

What are the different types of SQL commands?

- Data Definition Language (DDL): Used to define, modify, and delete database objects such as tables, indexes, and views. Examples include CREATE, ALTER, and DROP. - Data Manipulation Language (DML): Used to retrieve, insert, update, and delete data from tables. Examples include SELECT, INSERT, UPDATE, and DELETE. - Data Control Language (DCL): Used to manage access permissions on database objects. Examples include GRANT and REVOKE. - Data Query Language (DQL): Used to retrieve data from the database. The primary command is SELECT.

How to Implement Test Hooks

- Define setup and teardown actions using Cucumber hooks if necessary. - Annotate methods with @Before and @After to execute setup and teardown logic before and after scenarios. - This establishes consistent pre-test conditions and teardown actions, ensuring test environment stability and reliability.

How to Create Test Runner

- Develop a Java class for the test runner. - Annotate the class with @RunWith(Cucumber.class) to specify Cucumber execution. - Provide options like features, glue, and plugins to configure test execution.

How do you store and compare the data coming from the API?

- Extract relevant data elements from the API response. - Compare the extracted data with expected values using conditional statements or comparison operators. - Handle dynamic data appropriately, considering techniques like ignoring, substituting, or using regular expressions. - Use assertion methods from testing frameworks or validation libraries to validate data. - Log relevant information and discrepancies for debugging and troubleshooting. - Implement error handling to gracefully manage unexpected scenarios. - Consider automating data comparison for efficiency and consistency. - Integrate data comparison seamlessly into existing test frameworks or scripts for comprehensive testing.

How do you validate JSON?

- First, I parse the JSON data to make it readable and usable in our tests. - Then, I check specific elements or properties within it to ensure they match the expected values or patterns. - Then, I verify that the data contained in the JSON is correct, accurate, and meets the requirements of your test cases or application.

How you initialize your webdriver?

- First, I set the path to the WebDriver executable for the browser I want to automate. This ensures Selenium can launch and control the browser. - Next, I create an instance of the WebDriver using the appropriate WebDriver class for the browser. This instance represents the browser that Selenium will control during the automation process. - Then, I use the initialized WebDriver to perform various actions such as navigating to web pages, interacting with elements, submitting forms, etc. - Finally, after completing my tasks, I close the browser window to release system resources properly; using quit() method, for example. ChromeDriver ~ Google Chrome. GeckoDriver ~ Mozilla Firefox. EdgeDriver ~ Microsoft Edge.

What is the difference between GROUP BY and HAVING clauses?

- GROUP BY clause: Groups rows that have the same values into summary rows. It is used with aggregate functions (e.g., SUM, COUNT, AVG) to perform calculations on groups of data. - HAVING clause: Filters groups of rows based on specified conditions. It is used to apply conditions to the results of the GROUP BY clause.

How do you handle popup windows in Selenium?

- I typically use the getWindowHandles() method to get handles of all open windows. Then, I iterate through these handles to switch to the desired window using driver.switchTo().window(handle). - Once in the popup window, I perform actions as needed. After completing tasks in the popup, I switch back to the main window if required using driver.switchTo().window(mainWindowHandle).

How do you handle Frame in Selenium?

- I use the switchTo() method to navigate between frames. I identify the frame by its name, index, or web element, then switch to it using driver.switchTo().frame(). - Once inside the frame, I perform actions as needed, such as locating and interacting with elements. After completing tasks within the frame, I switch back to the default content using driver.switchTo().defaultContent().

How do you design and implement automated test suites?

- I'd first define test objectives and identify test scenarios. Then, I select appropriate tools like Selenium WebDriver and JUnit/TestNG for Java-based applications. - Next, I'd set up the test environment to mirror production conditions and write efficient test scripts. - I ensure proper test data management and integrate testing into our CI/CD pipeline for automation. - After executing tests, I analyze results and refine test suites as needed. -Collaboration and communication with stakeholders are key throughout the process to ensure alignment and transparency.

What is the difference between INNER JOIN and OUTER JOIN?

- INNER JOIN: Returns only the rows from both tables that have matching values based on the specified join condition. Rows from either table that do not have a match in the other table are excluded from the result set. - OUTER JOIN: Returns all rows from one or both tables, along with matching rows from the other table (or NULL values if no match is found). There are three types of OUTER JOIN: LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN.

How to Implement Reporting

- Integrate reporting plugins like Cucumber HTML Reports or ExtentReports to generate detailed test reports. - Configure reporting options in the test runner class to specify the output directory and format of the reports.

IoT Security

- Involves protecting Internet of Things (IoT) devices, networks, and data from security breaches and unauthorized access. - Topics include encryption, authentication, access control, secure bootstrapping, firmware updates, and secure communication protocols. - Common security challenges in IoT include vulnerabilities in devices, insecure network connections, and data privacy concerns.

IoT-Edge with Java

- IoT Edge refers to the computing infrastructure that exists close to IoT devices, typically at the edge of the network. - Java is a popular programming language commonly used for developing IoT Edge applications. - Domain skills in IoT-Edge with Java involve understanding how to develop, deploy, and manage Java-based applications that run on IoT Edge devices.

Where do you store or access your test data?

- It depends on the framework and its implementation. We can store it in a properties files or Excel files. - If it's Cucumber, test data can be provided through test steps using data tables.

Implicit Wait

- It tells Selenium to wait a certain amount of time for an element to appear on the page before giving up and throwing a NoSuchElementException. - It applies to every element in your script by default. - Use it if elements take some time to load on your webpage. - You set it once at the beginning of your script.

How to Create A Maven Project

- Open Eclipse, go to File ➡ New ➡ Maven Project. - Choose "simple project", then enter Group Id, Artifact Id, and click Finish to create the Maven project. - I prefer Maven for its dependency management capabilities, easy integration of libraries & plugins, and organizational benefits.

How to Add Dependencies:

- Open the pom.xml file and add dependencies for Selenium WebDriver and Cucumber within the <dependencies> section. - Maven will automatically download the dependencies, ensuring smooth project setup.

How to Create Page Objects (using POM)

- Organize web elements and interactions by creating Page Object classes for each web page or component. - Define web elements using @FindBy annotations and methods within Page Object classes. - Encapsulating web elements enhances readability, reusability, and robustness in test scripts.

'this' Keyword

- Refers to the current instance of the class in which it appears. - It can be used to access instance variables and methods of the current object. - It can also be used to invoke constructors of the current class, including overloaded constructors.

'super' Keyword

- Refers to the superclass (parent class) of the current class. - It can be used to call methods and constructors of the superclass. - It is often used to access superclass members that are hidden or overridden in the subclass.

IoT Automation

- Refers to the use of automated processes and systems to manage and control IoT devices and networks. - It involves implementing automation technologies such as sensors, actuators, and smart controllers to streamline operations and improve efficiency. - Automation in IoT can include tasks like data collection, analysis, decision-making, and remote device management.

How to Refactor and Maintain

- Regularly review and refactor the codebase to enhance readability, maintainability, and reusability. - This keeps dependencies updated and incorporate necessary changes or enhancements to the framework to ensure its efficiency and effectiveness over time.

How to Execute Tests

- Right-click on the test runner class and select Run As ➡ JUnit Test to execute the Cucumber tests. - Review the test execution in the console and inspect the generated output for any failures or errors.

What is Parallel Testing?

- Running multiple tests concurrently across different environments, configurations, or datasets. - Selenium Grid

What is Parallel Execution?

- Running multiple tests simultaneously within a single test environment. - TestNG supports

How do you verify the response body of an API?

- Send a request to the API endpoint using Postman. - Parse the response to extract the body content. - Compare the extracted body with the expected response. - Use assertions to check for equality, presence, or specific conditions. - Handle dynamic data using placeholders or extraction techniques. - Log relevant information for debugging and troubleshooting.

What methods do we use to convert an Integer to String?

- String.valueOf(): int num = 123; String str = String.valueOf(num); - Integer.toString(): int num = 123; String str = Integer.toString(num); - String.format(): int num = 123; String str = String.format("%d", num);

What kind of reports do you use?

- Test Execution Reports: These provide detailed insights into the execution of automated tests, including pass/fail status and test execution timelines. - Test Coverage Reports: These measure the extent of code tested by automated tests, helping identify areas that may require additional testing. - Defect Reports: Documenting issues identified during testing, including severity, description, and resolution status. - Code Quality Reports: Assessing code quality based on metrics like complexity, duplication, and adherence to coding standards. - Release/Deployment Reports: Documenting software release/deployment details and any encountered issues. - Test Automation Reports: Providing insights into test automation coverage, execution trends, and maintenance efforts.

Behavior-Driven Development (BDD) Framework

- Uses Cucumber with Gherkin syntax at both Banfield Pet Hospital and Comcast. This framework allowed for collaboration between testers and stakeholders by writing executable specifications in plain text, ensuring alignment with business requirements.

Page Object Model (POM) Framework

- Uses Java, Selenium WebDriver, and Cucumber at Banfield. - This framework provided a clear separation between test logic and page elements, enhancing the maintainability and scalability of automated tests for web applications.

Data-Driven Testing (DDT) Framework

- Uses tools like TestNG and JUnit to execute tests with various input data sets, enhancing test coverage and effectiveness. - Handles different test data scenarios efficiently.

How do you handle errors in your framework?

- We use try-catch blocks in our test scripts to manage exceptions. This helps us pinpoint the root cause of errors and take necessary actions, such as logging error details and performing cleanup tasks. - We rely on TestNG's assertion libraries to validate expected outcomes. If an assertion fails, showing unexpected behavior or errors, we log the failure and relevant information for debugging purposes. - For API testing with tools like Postman and Rest Assured Library, we ensure error handling is built into our testing process. This allows us to catch and address errors during API testing pretty fast. - And we integrate with logging and reporting frameworks to capture error details and generate comprehensive reports. This keeps stakeholders informed about test results and any encountered errors, allowing collaboration and troubleshooting. - Lastly, we use Jira as our bug tracking tool to manage and prioritize issues efficiently. This enables us to track errors reported during testing and ensure prompt resolution. Overall, our approach to error handling emphasizes proactive identification, logging, and resolution of errors to maintain the stability and reliability of our test automation efforts.

How to Implement Test Steps

- Write feature files in Gherkin syntax to describe test scenarios. - Create step definition classes corresponding to feature files. - Implement step definition methods using annotations like @Given, @When, and @Then to interact with Page Objects. - This promotes collaboration between technical and non-technical stakeholders, ensuring clear communication of test scenarios.

Explicit Wait

- You use it when you want to wait for a specific condition before proceeding. - It waits only for specific elements or conditions, not every element. - It's more efficient because it waits only as long as necessary. - Use it for waiting for elements with specific behaviors, like appearing, disappearing, or having certain values.

What are the steps involved in using Git when creating a new scenario?

1) Pull the latest changes - 'git pull' 2) Create a new branch - 'git checkout -b branch-name' 3) Write the scenario. 4) Stage and commit changes - 'git add <file>' or 'git add' 5) Push changes to the remote repository - 'git push origin branch-name' 6) Create a pull request for review. 7) Iterate based on feedback. 8) Merge changes into the main branch - 'git merge' 9) Cleanup by deleting the feature branch - ('git branch -d branch-name') + ('git push origin --delete branch-name')

What is REST Assured?

A Java library designed for testing RESTful APIs. It provides a simple and intuitive way to make HTTP requests, handle authentication, parse JSON/XML responses, and validate data. It's widely used for automated API testing to ensure functionality and reliability.

What is Fluent Wait in Selenium?

A flexible waiting mechanism that allows you to specify a maximum wait time and how often Selenium should check for a certain condition. It provides more control and customization compared to other wait methods, making it useful for handling dynamic web elements and unpredictable loading times.

Soft Assertion

A statement that checks multiple conditions within the same test case and allows the test to continue running even if one or more assertions fail. If it fails during test execution, it records the failure but does not stop the test execution immediately. It enable testers to gather information about multiple failures within a single test case, providing a comprehensive overview of the test results. Examples: assertAll (TestNG), assertThat (AssertJ), and verify (JUnit).

What is a responsive website?

A website design approach aimed at providing an optimal viewing and interaction experience across a wide range of devices and screen sizes, from desktop computers to mobile phones and tablets. In other words, it dynamically adjusts its layout, content, and functionality to suit the device on which it is being accessed, ensuring that users can easily navigate and interact with the site regardless of the device they are using. This adaptability is achieved through the use of flexible grids, images, and CSS media queries, allowing the website to respond and adapt to the user's device characteristics, such as screen size, orientation, and resolution.

What are the two main types of X-Paths?

Absolute & Relative

What is the difference between Abstract Class and Final Class?

Abstract Classes are designed to be extended by other classes, promoting inheritance and polymorphism and Final Classes ensure that no other class can extend them. This can be useful for making sure certain classes remain exactly as they are, which might be important for keeping data unchangeable or for security reasons.

Why do you use Cucumber?

Because it allows for behavior-driven development (BDD), encouraging collaboration between stakeholders and developers. With its human-readable feature files and step definitions, it promotes clarity and ensures alignment between requirements and tests. Additionally, Cucumber's support for parameterization and reusability enhances test maintainability and scalability.

How is the backend of an application or system managed?

By using SQL (for managing relational databases.)

What is Jenkin used for?

Continuous integration (CI), where code changes are automatically built, tested, and deployed. It's configured to monitor the VCS (Version Control System) for changes. When changes are detected, it triggers a build job, which involves compiling the code, running automated tests, and generating build artifacts.

Building Framework from Scratch, Step-by-Step

Create Maven Project Add Dependencies Create Page Objects (using POM) Implement Test Steps Implement Test Hooks Create Test Runner Write Test Scenarios Execute Tests Implement Reporting Refactor and Maintain

What tasks rely on Databases?

Data validation, integration testing, and resolving data-related issues within our applications.

How can deployment processes be automated in Jenkins to ensure consistency and reliability?

Deployment pipelines can be defined in Jenkins to automate the deployment process. These pipelines outline the steps involved in deploying an application, from building artifacts to deploying them to various environments such as development, staging, and production. By defining deployment pipelines in Jenkins, teams can standardize and automate deployment procedures, reducing manual errors and ensuring consistent deployments across different environments. Additionally, automation helps improve reliability by minimizing human intervention and providing traceability throughout the deployment process.

HAVING clause

Filters groups of rows based on specified conditions. It is used to apply conditions to the results of the GROUP BY clause.

HTTPS Methods

GET, POST, PUT, DELETE

GROUP BY clause

Groups rows that have the same values into summary rows. It is used with aggregate functions (e.g., SUM, COUNT, AVG) to perform calculations on groups of data.

What is the difference between soft and hard assert?

Hard assertions halt the test execution upon failure, while soft assertions allow the test to continue running and report all failures at the end of the test case.

How do you test your API?

I begin by understanding the API specs, then create and execute test cases covering various scenarios. I use Postman to send requests and verify responses, ensuring data integrity and security. For efficiency, I automate repetitive tests and assess performance under different loads. Integrating testing with other system components, I document results and share reports to ensure the API's reliability and quality.

How do you decide which test cases are to be automated?

I work closely with developers, product managers, and other stakeholders to identify the most suitable test cases for automation. This just makes the automation efforts align with the project's goals, priorities, and requirements. I assess factors such as frequency of execution, complexity, stability, and criticality to determine which test cases are prime candidates for automation.

You have a collection of random numbers in Java, some of which are duplicates. How would you extract only the unique values from this collection?

I would first create a List containing the random numbers, including duplicates. Then, I'd convert this list to a Set using HashSet, which automatically removes duplicates. Finally, I'd print the unique values contained in the Set.

How do you find how many text input fields are there on a page?

I would inspect the HTML structure of the webpage and iterate through using a For Loop for <input> elements with a type attribute set to 'text', as these represent text fields. By counting the occurrences of these elements, I can determine the total number of text fields present on the page.

How do you find how many hyperlinks are on a page?

I would inspect the HTML structure of the webpage and locate all <a> elements.

How would you rate yourself in Java on a scale of 1-10?

I would say I'm a 7-8 in Java. I've used it a lot in my work, and I feel pretty confident with it. But I'm always learning and trying to get better. I don't think you can master something that evolves the way that it does.

How would you get the URL you are trying to execute, using selenium?

I would use the getCurrentUrl() method. WebDriver driver = new ChromeDriver(); driver.get("https://example.com"); String currentUrl = driver.getCurrentUrl(); System.out.println("Current URL: " + currentUrl);

How does Fluent Wait handle timeouts?

If the condition is not met within the specified timeout period, Selenium throws a TimeoutException.

Difference between Implicit Wait and Explicit Wait

Implicit wait focuses on waiting for elements to become available, explicit wait concentrates on waiting for specific conditions to be fulfilled before moving forward with the code execution.

What is POM in automation testing?

In the Page Object Model (POM), each web page in the application is represented as a separate class, and the interactions and elements on that page are encapsulated within that class. This helps in maintaining a clean and organized codebase, as well as promoting reusability and easier maintenance of tests.

What does Jenkins do when all tests pass successfully?

It can trigger deployment processes to deploy the application to various environments (e.g., development, staging, production).

What kind of test automation matrix do you generate?

It depends on the specific project requirements and the needs of the testing team. But, typically, I focus on generating a comprehensive test automation matrix that covers different aspects of test automation efforts. - Test coverage: Tracking which functionalities, features, and user scenarios are covered by automated tests. - Automation framework usage: Documenting the automation tools, frameworks, programming languages, and libraries used for testing. - Execution environments: Identifying the different environments (ie. operating systems & browsers) where automated tests are run for compatibility. - Test data management: Detailing sources, formats, and management strategies for test data used in automated tests. - Execution status: Monitoring results of automated test runs over time to track progress & identify trends/issues. - Defects tracking: Documenting defects/issues found during automated testing, including severity, priority, and resolution status.

How do you handle the Synchronization issues?

It depends on the specific requirements of the test scenario and the behavior of the web application. For example, I might start with implicit waits to set a baseline timeout for WebDriver to wait for elements to become available. Then, I use explicit waits for more precise synchronization, waiting for specific conditions like element visibility or clickability before proceeding with the test script. Also, I might incorporate fluent waits for more dynamic scenarios where I need more control over waiting intervals and exceptions to ignore. While I try to minimize the use of Thread.sleep() because of its static nature, there may be rare cases where it's necessary, such as dealing with very unpredictable or unstable elements.

When does Explicit Wait throw an exception?

It does not inherently throw exceptions. Instead, it waits for a specific condition to be met before proceeding with the next steps in the script. However, if the specified condition is not met within the timeout, Selenium may throw a TimeoutException. The exception thrown is not related to element not found but rather to the condition not being met within the specified time.

CSS (Cascading Style Sheets)

It's crucial in web development for styling HTML elements. Understanding selectors, properties, layout techniques (like Flexbox/Grid), and responsive design principles are essential. It's also important for cross-browser compatibility, debugging, and optimizing stylesheets. While I don't work extensively with CSS, I grasp its fundamentals, which help me verify layout consistency, responsiveness, and styling during testing as an SDET.

What is Git used for?

It's used for Version Control.

What is one of the key features of Maven?

Its dependency management system. It can automatically download required libraries from remote repositories, such as the Maven Central Repository, based on the dependencies specified in the POM file.

What are the different Outer Joins?

LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN.

How do you calculate test automation coverage?

Multiply the ratio of automated test cases to the total test cases x 100. Test automation coverage is like checking how much of our testing is done automatically. - To calculate it, first, we identify what needs to be tested, like features or code. - Then, we see how much of that testing is done automatically with our automated tests. - Finally, we calculate. This percentage tells us how much of our testing is automated.

Can a Static Method call Non-Static Variables?

No, in Java, static methods cannot directly access non-static (instance) variables or methods. Static methods belong to the class itself and operate independently of any specific object's state. However, if you have an instance of the class, you can use it to access its instance variables and methods from within a static method. So, while static methods cannot directly call non-static variables, they can access them through an instance of the class.

What are Immutable Objects?

Objects whose state (data) cannot be modified after they are created. Once they're created, their state can't be altered. For example, in Java, Strings are immutable. Once you create a String like 'hello', you can't change it to something else.

Have you worked with Continuous Integration tools?

Oh yes, I use it a great bit - to set up my automated pipelines in our projects. I configure it to automate tasks like compiling code, running tests, and deploying applications. It plays a crucial role in streamlining our development process and ensuring the delivery of high-quality software.

How do you get data using the Cucumber?

One way to do this is by using the Scenario Outline feature along with the Examples section. With Scenario Outline, we write a generic scenario with placeholders for data. Then, in the Examples section, we provide specific values for those placeholders, effectively creating multiple variations of the same scenario. Cucumber then runs the scenario once for each set of data provided in the Examples section. Also, Cucumber allows us to fetch data from external sources such as CSV files or databases. This is useful when we have large sets of data or when we want to keep our feature files clean and organized. Another option is using data tables directly within our feature files. Data tables allow us to pass tabular data as arguments to our step definitions, making it easy to work with structured data. Lastly, we can store data during the execution of one step and retrieve it in subsequent steps using scenario context. This allows us to share data between steps as needed, which can be useful for scenarios where data needs to be passed from one step to another.

Can you tell me what kind of frameworks have you developed?

Page Object Model (POM) Behavior-Driven Development (BDD) Data-Driven Testing (DDT) Hybrid (POM, BDD, and DDT elements)

What is widely used for automated API testing to ensure functionality and reliability?

REST Assured

What is used for API testing?

REST Assured. It sends HTTP requests and validates responses against expected results.

OUTER JOIN

Returns all rows from one or both tables, along with matching rows from the other table (or NULL values if no match is found). There are three types of OUTER JOIN: LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN.

INNER JOIN

Returns only the rows from both tables that have matching values based on the specified join condition. Rows from either table that do not have a match in the other table are excluded from the result set.

What is used for web UI testing?

Selenium WebDriver: It interacts with the web browser to simulate user actions and verify expected behaviors.

What is GitHub?

Serves as a remote repository where developers can store their code.

What are used to navigate through the elements in an XML or HTML document in XPath?

Single slash (/) and double slash (//)

What is SQL?

Structured Query Language. - It is a standard language used for managing and manipulating relational databases. - It allows users to perform tasks such as querying data, inserting, updating, and deleting records, and creating and modifying database schemas.

XML (Extensible Markup Language)

Technical term: a markup language that allows users to define their own customized tags to structure and describe data in a hierarchical format. Importance in Testing: In the context of software testing, XML is often used for storing test cases, test data, and test results in a structured format. This allows automated testing frameworks to easily parse and manipulate the data, enabling efficient test execution and analysis. Automation role: I often use XML to define test scripts and test configurations in automation frameworks. XML's hierarchical structure and flexibility make it ideal for representing complex test scenarios and ensuring consistency across test suites.

THIS [T H I]

The current instance or object. Helps you access instance variables and methods of the current object. Invokes constructors of the current class.

What is normalization in database design?

The process of organizing data in a database to reduce redundancy and improve data integrity. It involves breaking down large tables into smaller, more manageable tables and defining relationships between them. The goal of normalization is to eliminate data anomalies, such as insertion, update, and deletion anomalies, and ensure that the database structure is optimized for efficient data storage and retrieval.

Imagine you're tasked with testing a specific function of a payment system, like PayPal integration, but you discover that PayPal is currently experiencing downtime. How would you proceed with testing in this scenario?

There are several strategies I would use. I'd use mocking frameworks to create mock objects and stubbing responses to simulate the behavior of the PayPal service. This allows us to continue testing the functionality of our payment system without relying on the actual PayPal service being operational. or I could conduct negative testing scenarios to verify how our payment system handles errors and failures from external services like PayPal. This involves simulating various error conditions, such as timeouts and connection errors, to ensure that our system gracefully handles such situations and provides appropriate error messages to users. Once PayPal is operational again, I would perform integration tests with the actual service to validate any temporary workarounds or fallback mechanisms implemented during the downtime.

What is acceptance criteria and who writes?

They are specific conditions or requirements that need to be met for a user story or feature to be considered complete and accepted by stakeholders. They define the boundaries of what's expected and help ensure that the work aligns with the project goals. Usually written collaboratively by the product owner, business analysts, developers, testers, and other stakeholders involved in the project. The product owner often leads this effort, representing stakeholders' interests and ensuring the product meets their needs. These criteria should be clear, measurable, and testable, allowing the team to verify that the work has been completed satisfactorily. They're crucial for acceptance testing, where stakeholders validate the functionality before it's released.

What is the advantage of using Fluent Waits?

They provide more control and flexibility compared to other wait mechanisms in Selenium. You can adjust the timeout and polling frequency based on the specific requirements of your test scenarios.

Why is groupid & artifactid crucial for Maven?

They resolve dependencies, manage project hierarchy, and organize artifacts within repositories. They also play a role in constructing the Maven repository path where artifacts are stored.

What are Desired Capabilities in Selenium WebDriver?

They're settings/preferences you can specify to customize how your tests run. It's like telling WebDriver, "Hey, here's how I want you to behave and what settings to use! For example, you can tell WebDriver which browser to use, its version, and even specific options like whether to run it in headless mode (without a visible browser window).

Why are Asserts used?

They're typically used within test cases to verify that certain conditions or expectations are met during test execution and to ensure software behaves as expected.

Hybrid Framework

This hybrid framework combines the strengths of POM, BDD, and DDT methodologies to address specific testing needs efficiently. By integrating these approaches, we ensure clear separation of test logic and page elements, promote collaboration through executable specifications, and handle various test data scenarios effectively.

What is artifactId?

This is the unique identifier for the specific project within the groupId. It's akin to the project's name or title and distinguishes it from other projects within the same group. For instance, if the project is a library named "utils", then "utils" would be its artifactId.

What is groupId?

This serves as the project's namespace, indicating its origin or creator, typically following a reverse domain naming convention. It represents the organization or group responsible for the project's development. For example, if a project is developed by Example Company, its groupId might be com.example.

Absolute XPath

This type provides the complete path from the root of the HTML/XML document to a specific element. It starts with the '/' symbol and can become invalid if the structure of the document changes. For instance, /html/body/form/input[2] represents an absolute XPath.

What is POM.xml used for?

To define project properties, dependencies, repositories, and other configuration details, allowing Maven to automate various tasks like compilation, testing, packaging, and deployment.

Why is the Extends keyword used in Java?

To establish inheritance between classes

What is the benefit of strategically placing Asserts throughout tests?

To verify the correctness of the software under test and detect any deviations from expected behavior.

True or False: Final Classes act like a 'no trespassing' sign; they can be used directly but can't be extended further. They're often used when you want to make sure a class can't be changed or extended.

True.

True or False: In Java, Abstract Classes are like blueprints meant for other classes to build upon. They can't be used on their own but provide a structure for subclasses to follow.

True.

Can you tell me the statement to update a particular table in database?

UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition; You'd replace table_name with the name of the table you're targeting, then list the columns you want to update along with their new values. Finally, you'd add a WHERE clause to specify which rows should be updated based on certain conditions. This ensures that only the relevant rows get modified

What is Mock Testing useful for?

Unit testing, integration testing, and performance testing, helping ensure our code behaves as expected in different scenarios.

Relative XPath

Unlike absolute XPath, this type is more adaptable and general. It locates elements based on their relationships to other elements, making it less susceptible to structural changes in the document. An example is //input[@id='password'], which uses recognizable features rather than a fixed starting point.

Who writes the Acceptance Criteria?

Usually collaboratively by the product owner, business analysts, developers, testers, and other stakeholders involved in the project. The product owner often leads this effort, representing stakeholders' interests and ensuring the product meets their needs. These criteria should be clear, measurable, and testable, allowing the team to verify that the work has been completed satisfactorily. They're crucial for acceptance testing, where stakeholders validate the functionality before it's released.

How to perform right click using Selenium WebDriver?

We can use the Actions class, which provides methods for performing complex user interactions like mouse actions. actions.contextClick(element).perform();

What are the Agile processes you follow with your team?

We have regular sprint planning, daily stand-up meetings for status updates, bi-weekly sprint reviews, and retrospectives. We prioritize user stories based on business value, maintain a backlog, and stay flexible to adapt to changes and feedback throughout the development cycle.

How do you read data from Excel?

We use Apache POI in Java. This allows easy extraction of test data stored in Excel sheets, aiding our automated test cases. Apache POI simplifies navigation through the workbook, making data retrieval efficient and integration smooth within our automation framework.

How do you handle Test Execution?

We use TestNG to manage and execute tests. It organizes tests into groups and runs them in parallel, saving time. Maven initiates test execution by managing project dependencies and running tests automatically. TestNG ensures smooth test execution by running tests in parallel. Jenkins automates test execution whenever code changes, keeping tests up-to-date. Overall, our test execution approach is simple, for fast and reliable tests.

When does Implicit Wait throw an exception?

When an element is not found within the specified timeout period. This timeout applies to every find element call in your script. If an element is not found within the timeout, Selenium throws a NoSuchElementException.

In your opinion, is Cucumber necessary for the Agile and for the Waterfall Methodologies?

While Cucumber can offer benefits in both Agile and Waterfall methodologies by promoting collaboration, improving test coverage, and maintaining documentation, its necessity may vary depending on project requirements and team dynamics. In Agile, its focus on rapid feedback and iterative development makes it particularly valuable, whereas in Waterfall, it may require more upfront planning and documentation.

What is the difference between Scenario and Scenario Outline?

While both Scenario and Scenario Outline define test scenarios, Scenario is for individual, fixed scenarios, whereas Scenario Outline is for parameterized scenarios that can be executed with different sets of data.

Do you use TestNG?

Yes, I do for test automation. I think it's a powerful testing framework for Java that offers features such as annotations, assertions, parameterization, grouping, and parallel execution. With TestNG, I can easily organize test cases into suites, execute tests in parallel to save time, and generate detailed test reports for analysis. Also, TestNG's built-in functionalities, such as data-driven testing and dependency management, help me create more tough and maintainable test suites.

Have you worked with CSS?

Yes, I have some basic familiarity with CSS. While it's not something I work with extensively, I understand its fundamental concepts and how it relates to web development and testing.

Do you have any experience working with Databases?

Yes, I work with them a lot. I interact with them to perform tasks like retrieving and updating data, executing SQL queries, and ensuring data integrity. I'm pretty goo with SQL queries to extract specific information and perform various operations, including joins and aggregation. My experience spans relational database management systems like MySQL, PostgreSQL, and Oracle. This is crucial for tasks like data validation, integration testing, and resolving data-related issues within our applications.

Have you setup any job in Jenkins?

Yes, I've set up jobs in Jenkins as part of my test automation work. I've used it to run automated tests, deploy applications, and create reports. I've organized complex workflows using Jenkins pipelines and connected them with version control systems like Git for continuous integration and delivery. I've also made sure our tests and deployments happen when needed by setting up triggers for events like code changes or scheduled runs. Overall, working with Jenkins has been super important for creating smooth and reliable processes in our projects.

Do Abstract Classes have constructors?

Yes, they do. These constructors are used to set up initial values or perform necessary tasks. When you create an object from a class that extends or inherits from the abstract class (called a subclass), the constructor of the abstract class is automatically called in the background to help set up the new object. So, while abstract classes can have constructors, they're not directly used to create objects. Instead, they quietly assist in initializing objects of the classes that extend them. Essentially, abstract class constructors work behind the scenes to aid the subclasses.

Do you run Parallel Execution in your framework and how you do it?

Yes, we use TestNG. STEPS: 1) Configure TestNG : TestNG is configured using XML file (typically named testng.xml) In this file, we specify the tests we want to run and how we want them to be executed, including parallel execution settings. 2) Organize our Tests Ours tests are organized into separate test classes; each containing one or more test methods. Test classes should be designed to run independently, without dependencies on each other. 3) Execution: Once TestNG is configured and your tests are organized, you can run them using TestNG's test runner. TestNG will execute the tests according to the configuration specified in the XML file. Multiple tests will run simultaneously, speeding up the testing process. 4) After the tests are executed, TestNG provides detailed status reports of each test method (pass, fail, skip). These reports help you analyze the results of your tests and identify any issues that need attention.

Do you run parallel execution in your framework and how you do it?

Yes. First, I create a TestNG XML file where I define my test suites and specify which classes or methods I want to run in parallel. In this file, I set the 'parallel' attribute to either 'tests', 'methods', or 'classes' mode, and specify the number of threads with 'thread-count'. Next, I use Maven as my build tool, I set up the Surefire plugin in the project's pom.xml file and I specify the parallel mode and thread count to allow parallel execution. Before running the tests, I ensure that my test classes are thread-safe. This means avoiding the use of static variables or shared resources that could cause conflicts between threads. Finally, once everything is configured, I run my TestNG tests as usual. I can initiate the tests from from Eclipse.

Do you think capture can be automated?

Yes. We can automate the capture of screenshots during test execution to document the state of web pages or applications. Additionally, automation scripts can extract and capture data from different sources such as websites, databases, APIs, or files, saving time and ensuring accuracy. Automation can also capture images or record video streams from webcams or other devices, which can be useful for tasks like image recognition or surveillance.

Have you ever automated any web services by using Java code?

Yes. In previous projects, I've used Java libraries such as REST Assured to automate interactions with RESTful APIs. I've been able to send HTTP requests, handle responses, and validate data returned by web services. I've also integrated these automated tests into continuous integration pipelines, to make sure that API functionalities remain consistent across deployments.

Do you use Rest Assured?

Yes. It's a Java-based library that makes API testing easy. With it, we can send requests to APIs, check the responses we get back, and make sure everything works as expected. It's a handy tool for ensuring the quality of our software's backend functionality.

Is Rest Assured included as a dependency in your project's POM.xml file?

Yes. It's an important part of our testing framework for API testing. By having Rest Assured configured in our POM.xml, we ensure that our project has access to all the features and capabilities it offers, allowing us to effectively test RESTful APIs within our application.

Do you have experience on Maven and POM.xml?

Yes. Maven helps manage project dependencies and build processes - While the pom.xml file is where we configure project settings like dependencies and plugins. Keeps projects organized and makes sure everything works smoothly.

Do you run two different browser in the same time when you execute parallel?

Yes. We can specify which browsers we want and TestNG will distribute the tests in those multiple browser instances.

Where do you Assert?

commonly placed within test methods or test steps, usually following the execution of actions or operations.

What is 'this' and 'super' keyword?

this is used to refer to the current object or instance, while super is used to refer to the superclass of the current class. Both keywords are essential in Java programming, especially in object-oriented programming scenarios.

Symbol for 'OR' operator

||

What is Docker?

• A platform that allows developers to package their applications and all of their dependencies into a standardized unit called a container. • These containers can then be easily deployed and run on any system that supports Docker, providing a consistent environment for the application to run in. • Think of it as a lightweight, portable, and self-sufficient package that includes everything your application needs to run, from code to libraries and dependencies. In summary, Docker is a technology that simplifies the process of packaging, deploying, and running applications, and it can be used in conjunction with AWS EC2 to leverage the scalability and flexibility of cloud infrastructure. As an SDET, Docker can help you create consistent testing environments, automate testing processes, and deliver high-quality software more efficiently.

How does Docker tie into AWS EC2?

• AWS EC2 (Elastic Compute Cloud) is a web service that provides resizable compute capacity in the cloud. It allows you to rent virtual servers, called instances, on which you can deploy your applications. • Docker can be used with AWS EC2 to run your containerized applications. You can deploy Docker containers onto EC2 instances, allowing you to take advantage of the scalability, reliability, and flexibility of AWS infrastructure while maintaining the consistency and isolation provided by Docker containers.

What are the different ways to handle Dynamic X-Paths?

• Identify Stable Attributes: Focus on attributes that remain constant across variations of the element, such as IDs or data attributes. • Use Relative XPaths: Construct XPath expressions based on the relationship between elements rather than relying on absolute paths. • Use XPath Functions: Utilize functions like contains(), starts-with(), or ends-with() to match partial attribute values. • Wildcards: Employ wildcard characters like * to represent any element or attribute, providing flexibility in matching. • Regular Maintenance: Regularly review and update XPath expressions to ensure they remain effective as the application evolves.

What are the main components of your framework?

• It comprises of a Maven project structured in Java, following the Page Object Model for organization. • Selenium WebDriver and TestNG are used for web automation, while Postman and Rest Assured Library handle API testing. • TestNG manages test cases and executions, with Maven handling dependency management. • We use Jenkins for continuous integration, Apache POI for data-driven testing, and Docker for containerization. • AWS EC2 instances provide flexible testing environments. Jira serves as our bug tracking tool, and Agile methodologies guide our teamwork and collaboration.

CSS Selectors

• Preferred for selecting elements based on their attributes like class, id, or tag name. • Generally faster and more efficient compared to XPath. • Offers a simpler and more concise syntax, making it easier to write and understand. • Better supported by modern browsers and widely used in web development.

Agile Methodology

• Testing is integrated throughout the development process, with each iteration incorporating testing activities alongside development. • Automation testing is often initiated early in the development cycle, with a focus on continuous integration and continuous testing. • Test cases are dynamic and flexible, evolving as requirements change and new features are added. • Testing activities are more collaborative, with testers working closely with developers and stakeholders to provide feedback and ensure quality at every stage. • Feedback loops are short, allowing for rapid iteration and adjustment based on user feedback and changing requirements. • The emphasis is on delivering working software in short, iterative cycles, prioritizing customer feedback and adapting to changing needs.

Waterfall Methodology

• Testing is typically performed in a sequential manner after the development phase is complete. • Automation testing often starts after the manual testing phase, focusing on regression testing and ensuring that previously developed features continue to function correctly. • Test cases are usually predefined based on the requirements gathered during the planning phase. • Testing activities are more rigid and structured, with a comprehensive test plan created upfront. • Feedback loops between testers and developers are limited, as changes are not easily accommodated once development has progressed to the testing phase. • The emphasis is on thorough documentation, including test plans, test cases, and test reports.

Key Differences of Waterfall vs. Agile Methodologies

• Timing: In Waterfall, testing is typically performed after development, while in Agile, testing is integrated throughout the development process. • Flexibility: Waterfall testing is more rigid and predefined, while Agile testing is dynamic and adaptable to changes. • Collaboration: Agile encourages collaboration between testers, developers, and stakeholders, whereas Waterfall follows a more structured and sequential approach. • Feedback: Agile provides shorter feedback loops, allowing for rapid iteration and adjustment, whereas Waterfall feedback is more limited and comes later in the process. • Documentation: Waterfall places a greater emphasis on documentation, while Agile prioritizes working software over comprehensive documentation.

When is X-Path or CSS preferred?

• XPath is preferred when dealing with complex or dynamic web page structures where CSS selectors may not be sufficient. • CSS selectors are preferred for simpler and more straightforward element selections, especially when targeting elements by their attributes.

Where do you source the data required for your automated testing?

🎁 CSV or Excel Files: They can imported into test scripts. This method offers the advantage of easier management and editing of test data outside of the code. 🎁 Database: Test data can be retrieved directly from a database. This approach is useful for applications that heavily rely on data stored in databases. 🎁 Property Files: Test data can be stored in property files, which consist of key-value pairs, and then imported into your test scripts. This method is straightforward and allows for convenient management of test data. 🎁 APIs or Web Services: Test data can be obtained from external APIs or web services. This approach is beneficial for applications that interact with external systems or services.


Related study sets

Ch. 10, Biology, Ch. 10 Vocabulary - Biology

View Set

Deel 2 : 3 bouw en functie van de plant in relatie tot de fotosynthese

View Set

Chapter 4- lesson 1 and 2 Health

View Set

MGMT CH7 (LMX Theory) Sage Quiz Questions

View Set