SQA

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

How ci/cd works in your company?

"we have our automated smoke test run on every build to our UAT environment" or "our full regression suite runs whenever we merge the develop branch with master"

SOLID principles, DRY, KISS, YAGNI with examples in automation frameworks?

5. Dependency Inversion Principle (DIP) Definition: High-level modules should not depend on low-level modules. Both should depend on abstractions. Example in Automation: Rather than directly instantiating a specific Logger (like a FileLogger) within your test classes, depend on a Logger interface, and use dependency injection to provide the specific implementation. This decouples your test classes from the concrete logger implementation. DRY (Don't Repeat Yourself) Definition: Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. Example in Automation: If multiple test cases require logging into a web application, encapsulate the login steps in a single method or class instead of duplicating the login steps across test cases. KISS (Keep It Simple, Stupid) Definition: Systems work best if they are kept simple rather than made complex. Simplicity should be a key goal in design, and unnecessary complexity should be avoided. Example in Automation: When designing a function to capture screenshots on test failure, implement it in a straightforward manner using existing hooks or listeners provided by the test framework instead of creating a complex custom implementation. YAGNI (You Aren't Gonna Need It) Definition: Don't implement something until it is necessary. Example in Automation: Avoid implementing elaborate reporting features or complex test data management solutions upfront. Start with basic implementations and extend them only when specific requirements arise.

What is a version control system (VCS)?

A VCS keeps track of the contributions of the developers working as a team on the projects. They maintain the history of code changes done and with project evolution, it gives an upper hand to the developers to introduce new code, fixes bugs, and run tests with confidence that their previously working copy could be restored at any moment in case things go wrong.

Can you explain head in terms of git and also tell the number of heads that can be present in a repository?

A head is nothing but a reference to the last commit object of a branch. For every repository, there will always be a default head referred to as "master" or now "main" (as per GitHub) but there is no restriction to the count of heads available. In other words, it can have any number of heads. • Usages:- To go or checkout to 1 commit before the latest commit, we use git checkout HEAD~1- To uncommit the last 3 commits without losing the changes, we first run git reset HEAD~3. Then we can see the changes made in the last 3 commits and then update it manually and commit it finally.- In order to uncommit the last 3 commits and also remove the changes, we can run the command: git reset --hard HEAD~3. This command will completely remove all the changes.- To look into the changes made in the last 3 commits, we can run git diff HEAD~3- To make a new commit by reverting the last 3 commits, we can run the command: • git revert --no-commit HEAD~3...HEAD

What is a git repository?

A repository is a file structure where git stores all the project-based files. Git can either stores the files on the local or the remote repository.

What is the problem with Thread.Sleep in code?

Answer: - Theard.sleep() introduces a definite wait(that is fixed periods of inactivity) no matter what happens, which will slow down our test, and if you are using CI(Continuous integration) generally result take much time if we use it all over the place.

Suppose I gave you an application with no documentation and asked you to exploratory test it. What is your approach?

Approaching an undocumented application for exploratory testing, I would start by familiarizing myself with the application to understand its purpose and functionality. I'd then develop a set of test scenarios based on common user actions, paying special attention to critical features. As I explore, I'd note any anomalies or bugs and categorize them based on severity. This process involves a balance of structured and creative testing to cover as much of the application as possible.

Best Practices in using xpath

Avoid Absolute XPaths: They are brittle and likely to break with any UI changes. Use Relative XPaths: They are more resilient to changes in the UI structure. Inspect Elements Carefully: Tools like Chrome DevTools can help you understand the structure of the HTML and find patterns in dynamic attributes. Test and Validate: Ensure your XPath expressions work as expected by testing them in the browser's developer console or using tools designed for testing XPath queries.

Handling Authentication Pop-up, Alerts, Waits

Basic Authentication Pop-up: Pass credentials in the URL or use browser profiles. Alerts: Use WebDriver's Alert interface to interact with alerts. Waits: Utilize explicit waits (WebDriverWait) to wait for certain conditions or implicit waits to set a global waiting time.

Different Types of Authentication

Basic Authentication: Uses a username and password encoded in base64 format included in the request headers. Digest Authentication: Similar to basic authentication but with added security features like nonce values to prevent replay attacks. API Key: A unique identifier used to authenticate a user, developer, or calling program to an API. OAuth: An open standard for access delegation, used as a way to grant websites or applications access to their information on other websites but without giving them the passwords. JWT (JSON Web Tokens): A compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure. OAuth 2.0: The industry-standard protocol for authorization, focusing on client developer simplicity while providing specific authorization flows for web applications, desktop applications, mobile phones, and living room devices.

Why we shouldn't mix different wait strategies like implicit and explicit waits?

Because it can cause unpredictable waiting times

Why fluent waits are not popular?

Because there is usually no need to, it doesn't give any real advantages over explicit waits, we can think of fluent ways as of advanced explicit waits. In reality we can just use explicit waits without specifying the polling frequency.

Как подготовить тестовые данные?

Before developers build an actual rest api, they first specify the contract and write docs using swagger. We can use mock response they provide in that docs to start writing api tests before the rest api code is implemented, so instead of making requests to actual server we are going to use mocks, e.g: create a method that returns some json and pass this method as a parameter for jsonPath object in rest assured. Once api is implemented we just replace mock response with an actual response and that's it.

Define "Index" in git.

Before making commits to the changes done, the developer is given provision to format and review the files and make innovations to them. All these are done in the common area which is known as 'Index' or 'Staging Area'.

Best and worst practices of UI automation:

Best practices: Less is more - the less Ui interactions we have - the better because UI tests tend to be very flaky by its nature, so we need to minimize that flakiness. Test cases should be atomic - basically following the S in SOLID, brief and concise. Tests should be independent from each other and not affect each other. Tests should be independent from user state and application state. This is a fundamental aspect of test isolation. Clean and maintainable code, following SOLID principles, using design patterns, etc. Worst practices: Non atomics tests Static sleeps User and application state dependency Non readable code Code duplication Hardcoded test data

What are Browser engines?

Browser engines are software components that render web pages and display them to users. They are responsible for interpreting HTML, CSS, and JavaScript to render web content. Some common browser engines include: Blink (used in Google Chrome and Chromium-based browsers) Gecko (used in Mozilla Firefox) WebKit (used in Safari and many other browsers) Trident (used in older versions of Internet Explorer) EdgeHTML (used in older versions of Microsoft Edge) Browser engines play a crucial role in how web pages are displayed and interacted with by users.

Verifying/Validating Color and Underscore

CSS values can be retrieved using the getCssValue method. For verifying text decoration (like underscore), you can get the text-decoration CSS value. For color, use color and compare the returned value (usually in RGBA format).

Issues with executing tests in cloud?

Commands have to travel through network which slows the process and might make tests more flaky compared to running them on a local machine.

How to handle dynamic xpath

Contains() Function Using OR & AND Operators Starts-with() Function

how do you prioritize automating certain features?

Core Features: Focus on features that are core to the application's functionality. If a core feature fails, it could significantly impact the business. User Paths: Prioritize user journeys that are most commonly used. Automating these paths ensures that the most frequent user experiences are always tested.

What is CSRF?

Cross-Site Request Forgery (CSRF) is a type of security vulnerability that allows an attacker to induce users to perform actions that they do not intend to perform on a web application in which they're currently authenticated. It exploits the trust that a web application has in the user's browser and can lead to unauthorized commands being transmitted by the user.

Challenges faced in Selenium Automation and how did you handle that error?

Dealing with Stale Element Exceptions Problem: The team frequently encountered stale element reference exceptions when trying to interact with elements that had been dynamically updated or replaced in the DOM after an AJAX call. This was particularly problematic in the checkout process, where elements like discount code input fields and payment method options were dynamically updated. Solution: To overcome this, the team adopted several strategies: Re-locating Elements: They modified their scripts to re-locate elements right before interacting with them, ensuring that they had fresh references to the elements. Try-Except Blocks: Implemented try-except blocks to catch stale element exceptions, with retries to locate the element again within the exception handling code. Strategic Waits: Introduced strategic waits before performing actions that were known to update the DOM, minimizing the chance of interacting with stale elements.

How do you deal with situations where you do not have enough time to test?

Dealing with situations where there is not enough time to test is a common challenge in QA. In such cases, a risk-based testing approach can be effective. This involves evaluating the risk and impact of potential defects in different parts of the application and focusing your testing efforts on the areas that are most critical to the product's success. Communication with the project team is also crucial; you should clearly convey the risks of insufficient testing time and collaborate to adjust deadlines, scope, or resources as needed. For example, if you're nearing a release deadline and don't have enough time to conduct comprehensive testing on a new feature in a social media app, you might focus on testing the feature's core functionality, such as posting updates and interacting with posts, while deferring more in-depth testing of less critical functionalities, like customizing profiles or filtering feeds, to a later stage.

Lifecycle of Maven

Default Lifecycle: Handles project deployment. It includes phases such as: validate: Validates the project is correct and all necessary information is available. compile: Compiles the source code of the project. test: Tests the compiled source code using a suitable unit testing framework. package: Packages the compiled code in its distributable format, such as a JAR. verify: Runs any checks to verify the package is valid and meets quality criteria. install: Installs the package into the local repository, for use as a dependency in other projects locally. deploy: Done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects. Clean Lifecycle: Manages project cleaning. It has phases like: pre-clean: Executes tasks needed prior to the actual project cleaning. clean: Removes all files generated by the previous build. post-clean: Executes tasks needed to finalize the project cleaning. Site Lifecycle: Handles the creation of your project's site documentation. Key phases include: pre-site: Executes tasks needed before the site generation. site: Generates the project's site documentation. post-site: Executes tasks needed to finalize the site generation and to prepare for site deployment. site-deploy: Deploys the generated site documentation to the specified web server.

What is maven dependency, group id and artifact id?

Dependency: In Maven, a dependency is a reference to a library that your project needs to compile and run. Maven automatically downloads these libraries from a central repository and includes them in your project's build path. Dependencies are defined in your project's pom.xml file. Group ID: A unique base name that identifies the project or group that the project belongs to. Typically, it follows the package name rules, using the reversed domain name of the organization (e.g., com.example). The Group ID is part of the artifact's coordinates and helps Maven to uniquely identify the dependency in the repository. Artifact ID: The name of the jar without version. It is the unique identifier for a project's artifact within a group. For example, if a group creates several projects (artifacts), each will have its own Artifact ID, which, when combined with the Group ID (and a version), allows Maven to find and manage dependencies. For example, in com.example:mylibrary:1.0, com.example is the Group ID, mylibrary is the Artifact ID, and 1.0 is the version.

How would you handle getting data out of an HTML table?

Depends very much how was it implemented. If it has labels and the labels are linked with the data, use the label as key and get its rows. You can either use the order to get data from or a text, or attribute if you know what you want to put into a condition. Probs you can have a map with label as key and the rows list as value.

Desired Capabilities vs. Chrome Options:

Desired Capabilities: Desired Capabilities is a concept used in Selenium WebDriver to specify the characteristics or settings for a web browser or mobile device that you want to use for your automated tests. It is a set of key-value pairs that define various properties like browser name, version, platform, and other options. These capabilities are used to configure the WebDriver instance and establish a connection to the browser or device. Chrome Options: Chrome Options is a specific set of capabilities used when working with the Google Chrome browser in Selenium. It allows you to customize and configure various Chrome-specific settings, such as adding command-line arguments, setting preferences, managing browser windows, and handling SSL certificates. Chrome Options is a subset of Desired Capabilities focused on Chrome-specific configurations.

In jenkins - how often your build is run and different trigger scenarios like as soon as the dev build comes or nightly execution?

Development Builds: For development builds, triggering a build after every SCM change (using Poll SCM or webhooks) ensures that every change is immediately tested. Nightly Builds: For nightly builds or other regular testing cycles, "Build periodically" is the most straightforward choice, allowing for comprehensive tests that may be too time-consuming for every commit.

Why cucumber is not a good approach?

Extra maintenance requirements, the inconsistency between different projects and teams and overall the extra work to support Cucumber isn't worth it from a business standpoint. And then you can start discussing the fact that the business and devs are not using the syntax but somehow the testers are still using it sO tHe BuSiNeSs AnAlYsTs CaN uNdErStAnD but no one has ever seen the BAs care. Plus cucumber is no longer being supported.

What would you do if you realize you are behind the schedule?

First of all tell my manager. If I realize I'm behind schedule, my next step is to assess the project's remaining tasks and identify any that can be deprioritized or streamlined. I'd then communicate with stakeholders to set realistic expectations and, if necessary, negotiate deadline extensions. Meanwhile, I'd look for ways to optimize our workflow, possibly reallocating resources or seeking additional help to address the bottleneck areas. Transparency, communication, and strategic planning are key to managing such situations.

Handling Radio Buttons and Dropdowns

First, locate and click the desired radio button using standard WebDriver locating techniques. After the dropdown appears, you can interact with it using the Select class or by directly clicking the dropdown values based on their locators.

functional testing definition

Functional testing is a type of software testing that validates the software system against the functional requirements/specifications. The purpose of functional testing is to test each function of the software application, by providing appropriate input, verifying the output against the Functional requirements. This testing mainly involves black box testing and it is not concerned about the source code of the application. The main focus is on the execution of functions or features of the application and their interaction with the user interface, APIs, database, and other systems. The goal is to ensure that the application performs as expected and meets the user's requirements.

Challenges at work?

Getting to know the product because the main application that I worked at most of the my time at this company which is not even a single application it's like an umbrella term for more than a dozen of applications. And it is very different than what I am used to as a user. Because it is an accounting software and I am not an accountant and like all the financial calculations I have ever done myself in my whole life was just using Microsoft excel spreadsheets. And here it's a huge application that is older than me, it's been around since 90s. And as a qa I am supposed to know the product really well but tbh it feels not even our accountants know this application, because I am a friend with one of our accountants and sometimes I ask her about the application and she is like I have no idea I never used this functionality. And on top of that, for our applications that we sell to our clients we have a customer support, we have special trainers who help set up everything on clients side and teach them how to use everything, so like if I have a problem I could also ask them. But for this application we don't have anything like because we are the customer ourselves.

What is a git conflict?

Git usually handles feature merges automatically but sometimes while working in a team environment, there might be cases of conflicts such as:1. When two separate branches have changes to the same line in a file2. A file is deleted in one branch but has been modified in the other. • These conflicts have to be solved manually after discussion with the team as git will not be able to predict what and whose changes have to be given precedence.

how to write xpath for iframes, Ajax, SPAs?

Handling iframes: Switch to the iframe context Write XPath as usual Switch back to the main document Handling Ajax and SPAs: Ajax-loaded content and SPAs can change without the page itself being reloaded. This can make elements hard to find if they haven't been loaded yet, or if they change dynamically. Wait for elements to be loaded or become visible: Use explicit waits to wait for an element to be present or visible on the page. This is crucial for Ajax and SPAs where elements might be loaded dynamically. Use JavaScript to interact with SPAs: Sometimes, interacting with SPAs might require executing JavaScript to scroll to elements, open modal windows, etc. WebDriver can execute JavaScript directly. Like that: ((JavascriptExecutor)driver).executeScript("arguments[0].scrollIntoView(true);", element); XPath strategies for dynamic content: Use attributes and text content that are less likely to change, instead of relying on specific IDs or classes that might be dynamically generated. Use contains(), starts-with(), or ends-with() functions to match elements based on partial attribute values or text, which can be useful when dealing with elements that have dynamically generated IDs or classes.

how many test cases you can run in a days suppose you are a one tester in company how many time you will take test all module?

How many test cases can you run in a day? As the sole tester, the number of test cases you can run in a day depends on several factors, including the complexity of the test cases, the size of the application, the available resources, and your experience level. On average, you may be able to execute and document around 50 to 100 test cases per day, considering thorough testing, bug reporting, and retesting. However, this number can vary widely based on the specific context and priorities. How much time will you take to test all modules? Testing all the modules thoroughly would require a significant amount of time, especially if the application is complex. Assuming that you are focused on comprehensive testing and debugging, it may take several weeks to months to ensure the quality of the entire application. The exact duration would depend on the size of the application, the depth of testing required, and the availability of resources.

What are the common problems with test automation?

Huge issue with automation is that there is no standard way of doing things, its not even about tests themselves its rather about the whole situation, different engineers have their own idea how test framework supposed to look like and different companies use different approaches to that.

What principles do you follow to ensure your code is clean, maintainable, and well-documented?

I adhere to several key principles for writing high-quality code. First, I follow the DRY (Don't Repeat Yourself) principle to avoid redundancy, which makes maintenance easier. Second, I use meaningful variable and method names to ensure readability. Third, I implement comprehensive error handling and logging to make debugging more straightforward. Finally, I prioritize writing clear, concise documentation alongside the code, detailing its purpose, usage, and any peculiarities. This approach not only makes my code easier for others to understand and use but also simplifies the onboarding process for new team members.

What is your approach to test data in automation, how would you handle, store, inject data into any of your suites?

I would use data provider classes to encapsulate logic for working with different types of data objects like json or excel spreadsheets. Then I would just use @DataProvider annotation for my test methods

Tell me about a challenging project/framework/tool you've created.

I'm looking to see you actually understand what you've worked on, or how involved you were. Many people put "helped build X test framework for Y company using Z technology" in their resume, but when I dig in, they actually did very little, or they just did what other people told them to do; they weren't making any of the decisions. I want to see that you contributed, that you understood. Follow-up questions: "If I gave you two weeks of dedicated time to work on this tool/framework again, what would you improve?" or "If you could go back in time with what you know now, how what would you do differently?"

Handling Frames Without ID, Name, or XPath

If a frame can't be identified by ID, name, or XPath, you can use CSS selectors or index numbers to switch to the frame. Iterating through all frames and identifying the desired frame by some unique content or attribute can also be a strategy.

Factory design pattern in selenium test automation:

In Selenium, the Factory pattern, specifically a form of the Factory Method, is commonly used to create instances of WebDriver. The WebDriver is an interface, and the specific implementation (like ChromeDriver, FirefoxDriver, InternetExplorerDriver, etc.) is chosen at runtime based on the desired browser. Here's how it typically works: WebDriver Interface: The main interface that all drivers (ChromeDriver, FirefoxDriver, etc.) implement. It provides the methods that are used for browser manipulation and navigation. Concrete Drivers: Each browser has its own concrete implementation of the WebDriver interface (e.g., ChromeDriver for Google Chrome, FirefoxDriver for Mozilla Firefox). Factory Method: Although Selenium does not provide a built-in factory class in its API, the pattern is used when developers implement their own factory to create instances of WebDriver. This factory method decides which browser driver to instantiate based on some input (like browser type specified in configuration or system properties).

How to prioritize test cases in TestNG?

In TestNG "Priority" is used to schedule the test cases.at is we can execute Test case in order. In order to achive, we use need to add annotation as @Test(priority=??). The default value will be zero for priority.

Thread Count in TestNG

In TestNG, a test framework for Java, the thread count refers to the number of parallel threads or instances in which your test methods can run concurrently. TestNG allows you to specify the thread count at various levels, such as at the suite, test, or method level. Controlling thread count is useful for achieving parallelism in your test executions, which can significantly speed up test suite execution.

Подробно о Thread Safety в automation frameworks? Why Thread Safety is Important?

In an automation framework, especially when tests are executed in parallel: Isolation: Each test should run in isolation to ensure that the actions or data of one test do not affect another. Stability: Ensures the test suite is stable and reliable, with predictable outcomes for each test execution. Performance: Properly managed threads can significantly improve the performance of your test suite by utilizing system resources efficiently. Achieving Thread Safety with ThreadLocal ThreadLocal in Java provides thread-local variables. These variables differ from their normal counterparts in that each thread accessing such a variable via a get or set method has its own, independently initialized copy of the variable. ThreadLocal instances are typically private static fields in classes that wish to associate state with a thread. ThreadLocal can be used to ensure that each thread has its own instance of WebDriver. This way, when tests are run in parallel, each test thread can interact with its own browser session without affecting others. Best Practices for Thread Safety in Automation Frameworks Initialization and Cleanup: Ensure that each thread correctly initializes its test environment before tests run and cleans it up afterwards. ThreadLocal variables should be removed once a test is finished to prevent memory leaks. Accessing Shared Resources: Be cautious when accessing shared resources from tests. Use synchronization mechanisms if necessary to prevent race conditions. Logging and Reporting: Ensure that logging and reporting are configured to handle parallel execution correctly. Logs should be separated or clearly marked to indicate which test and thread they belong to. Avoid sharing test data between threads unless it is immutable or properly synchronized.

Tips on working with locators?

In general, if HTML IDs are available, unique, and consistently predictable, they are the preferred method for locating an element on a page. They tend to work very quickly, and forego much processing that comes with complicated DOM traversals. If unique IDs are unavailable, a well-written CSS selector is the preferred method of locating an element. XPath works as well as CSS selectors, but the syntax is complicated and frequently difficult to debug. Though XPath selectors are very flexible, they are typically not performance tested by browser vendors and tend to be quite slow. Selection strategies based on linkText and partialLinkText have drawbacks in that they only work on link elements. Tag name can be a dangerous way to locate elements. There are frequently multiple elements of the same tag present on the page. This is mostly useful when calling the findElements(By) method which returns a collection of elements. The recommendation is to keep your locators as compact and readable as possible. Asking WebDriver to traverse the DOM structure is an expensive operation, and the more you can narrow the scope of your search, the better.

Can you give an example of a project where you had to balance following leadership directives with contributing your own expertise? How did you handle it?

In one of our recent projects, we faced a significant challenge with our test automation framework, which was not scaling well with the increased test load. The leadership was inclined towards a complete overhaul, but I suggested optimizing the existing framework instead. I took the initiative to conduct a detailed analysis, identifying bottlenecks and proposing targeted improvements. I presented my findings and a prototype demonstrating the potential improvements. This approach saved time and resources. My ability to back my expertise with data and present a clear argument led to leadership adopting my proposal, which ultimately enhanced our project's efficiency.

Describe a situation where your analytical and debugging skills helped solve a complex problem?

In one project, we encountered a persistent and elusive bug affecting our application's performance only under specific conditions. By methodically breaking down the application's behavior and using a combination of logging and profiling tools, I isolated the issue to a third-party library that was not handling certain data types efficiently. I then worked on a workaround to preprocess the data before sending it to the library and submitted a bug report to the library's maintainers. My analytical approach not only resolved the immediate issue but also contributed to improving the library for the broader community.

There is a submit button in page it has id property. By using "id" we got "element not found expectation", how will you handle this situation? What might be the problem in this case?

In this situation, there are mainly two reasons that are:- ID is not matching ID is changing each time when load the page. So to handle this situation instead of using find element by Id, we can use find element by Xpath.

Advantages of Selenium RemoteWebDriver

It allows for the execution of Automation test suites or batches on multiple machines at the same time It enables test case execution with browsers that are not available on the current OS. In simple terms, it is OS-independent. It returns an exception with an accompanying screenshot so testers know what issue has occurred. It allows testing of a web application on a remote server, even before making it live. Hence, local testing saves time and cost with early bug detection.

Challenges with explicit wait strategies?

It applies to a particular element unlike implicit waits that are applied to the whole session. So when applying explicit waits we need to think of reusability. We can have some global timeouts set up and just using them depending on the type of the interaction.

To use page factory or not?

It is just a matter of preference, it doesn't have any real practical advantages or disadvantages but the code looks nicer in my opinion when when use it.

Why inheritance is bad?

It is not bad per se but it's usage can cause certain problems such as tight coupling. And changes in one class can affect or might require changes in the other.

Traversing to a Particular Element in JSON Response

JsonPath jsonPath = new JsonPath(response); String elementValue = jsonPath.getString("path.to.element");

What are the limitations of css selectors?

Locating element by part of the Inner Text cannot be used for locating elements with their visible text available between opening and end tags. This is a limitation of CSS.

Why UI tests flaky?

Many reasons: network delays, stale elements, developer changed something in the code, browser bugs or just inconsistency, the application itself is slow or buggy.

Java Concepts in Framework

Method Overriding: Redefining a superclass method in a subclass, used to provide specific implementations. Method Overloading: Having multiple methods with the same name but different parameters, used for flexibility in calling methods. Abstract Class and Interface: Used for defining a contract for subclasses and for multiple inheritance, respectively. They can define the structure without implementing all details. HashMap Usage: Often used to store unique elements as key-value pairs, useful for managing data sets like test data or element locators.

How have your strong oral and written communication skills contributed to your team's success?

My communication skills have been crucial in several aspects of my work, especially in documentation and cross-team collaborations. For instance, I was responsible for updating our QA documentation, which was initially dense and technical. By rewriting it in a more accessible language and including practical examples, I made it easier for new team members to understand our testing framework quickly. Additionally, my ability to clearly articulate technical challenges and solutions during meetings has facilitated smoother collaboration between the QA team and the development team, leading to a more agile problem-solving process.

How do you decide whether it is a frontend bug or a backend bug.. what things do you check so that you know it.

Network Inspection: Use browser developer tools to inspect network requests and responses. Errors or unexpected responses indicate backend issues, while correct responses with issues rendering or processing data suggest frontend bugs. Log Analysis: Server and application logs can indicate backend problems. Lack of errors suggests the issue may be frontend. Isolation Testing: Try to reproduce the issue using direct API calls (for potential backend issues) or static mockups (for frontend). Consistency Check: If the issue occurs across different clients or browsers, it's likely a backend issue. Browser-specific issues often point to frontend problems.

Can we run in parallel a test that uses data provider - for each possible value there would be a separate parallel test?

No, because it would create a race condition because many drivers will try access same file at the same time.

Areas Where We Cannot Use Explicit Wait in Selenium

Non-DOM Changes: Explicit waits are designed to wait for changes within the DOM (Document Object Model). If you're waiting for something that doesn't affect the DOM (like a file to download or an operation that occurs outside the browser), explicit waits won't be effective. Browser Alerts: Selenium's explicit wait mechanism cannot be used to wait for browser-level alerts or pop-ups since they are not part of the DOM. Instead, you would use WebDriver's Alert interface to interact with them. Page Load Completion: Although Selenium provides a way to wait for page load completion to a certain extent, explicit waits are not designed to verify that all elements on a page have fully loaded, especially for elements loaded asynchronously via JavaScript after the initial page load. You would need to target specific elements or conditions to ensure the page is fully loaded. Network Traffic: Waiting for network calls to complete, such as AJAX or API calls made by the application, cannot be directly achieved using explicit waits unless these calls result in a detectable change in the DOM. External Processes: Operations that happen outside the web browser, such as interactions with the operating system, external applications, or the file system, are beyond the scope of explicit waits.

When to use explicit waits?

On each element on the page

Can you give me an example where a test pyramid model may not work well?

One example where the test pyramid model may not work well is when you have a very large and complex application. In this case, it may be difficult to create unit tests that cover all of the functionality, and it may be more effective to focus on creating fewer, but more comprehensive, integration tests.

What is POJO, serialization and de-serialization?

POJO (Plain Old Java Object): A simple Java object that does not extend or implement specific frameworks' classes and interfaces. In the context of APIs, POJOs are often used to model the request and response structures. Serialization: The process of converting a POJO (or any object) into a format that can be easily stored or transmitted (e.g., converting a Java object into a JSON string for an API request). Deserialization: The reverse process of serialization, where data in a format like JSON is converted back into a Java object. This is commonly used to interpret responses from API calls.

How would you change the nested part of the JSON in API Automation

Parsing and Modifying: Use a JSON parsing library (like Jackson for Java or json for Python) to deserialize the JSON into a map or custom object, modify the nested part, and serialize it back to JSON. Direct Manipulation: For simple changes, directly manipulate the JSON string or use JSONPath expressions to update nested values.

Plugins vs. Dependencies in Maven

Plugins: In Maven, plugins are extensions or add-ons that provide additional functionality to the build process. Plugins are configured in the pom.xml file and can perform tasks such as compiling code, running tests, packaging applications, deploying artifacts, and more. They are usually bound to specific phases of the Maven build lifecycle. Dependencies: Dependencies in Maven are external libraries or components that your project relies on. These dependencies are specified in the pom.xml file and are downloaded from remote repositories during the build process. Maven manages the versioning and retrieval of these dependencies, ensuring that your project has access to the required libraries.

How to handle stale element exception?

Re-locate the Element When you catch a stale element exception, try to re-locate the element. This means you should locate the element again within the catch block or retry mechanism before performing any actions on it. Make sure the page is refreshed. If the element becomes stale because the page is being dynamically updated, sometimes refreshing the page and then re-locating the element can be a straightforward workaround.

Software Development Life Cycle (SDLC)

Requirement Analysis: Identifying and documenting the requirements from the stakeholders. Design: Defining the software architecture, components, interfaces, and data models. Implementation (Coding): Writing the code according to the design specifications. Testing: Verifying the software to ensure it meets all requirements and is free of defects. Deployment: Releasing the software to a production environment where it can be used. Maintenance: Providing ongoing support, making updates and improvements as needed.

Software Testing Life Cycle (STLC)

Requirement Analysis: Understanding the requirements in terms of testable elements. Determining the scope and risks. Test Planning: Planning the overall testing activities, including resources, timelines, and tools required. Test Case Development: Designing and writing test cases based on requirements. Preparing test data. Environment Setup: Setting up the testing environment with necessary hardware and software. Test Execution: Running the test cases, logging defects for any discrepancies found. Test Cycle Closure: Analyzing the results, ensuring all requirements are tested, and documenting the findings for future reference.

What would make you choose our company over others?

Research about the company before interview and then say you have the same life path как учил Портнов и скажи как тебе нравится то чем они занимаются

Reasons a Service Can Go Down

Resource Exhaustion: Running out of memory, CPU overload, or disk space. Dependency Failures: Downstream services or databases becoming unavailable. Network Issues: Connectivity problems or DNS failures. Configuration Errors: Incorrect settings or environmental mismatches. Code Issues: Bugs, unhandled exceptions, or security vulnerabilities.

Selenium Architecture & Browser Interaction

Selenium WebDriver follows a client-server architecture. The client, written in languages like Java, Python, or C#, sends commands to the server (the WebDriver). The server then communicates with the browser through a browser-specific driver (e.g., ChromeDriver for Chrome, GeckoDriver for Firefox). This communication is done over HTTP using the WebDriver protocol. Internally, the browser driver translates these commands into actions within the browser, allowing for automated testing of web applications.

How to do set priority, exclude the test cases, different annotations, how to run test cases in parallel?

Setting Priority: You can set priority on test methods using the @Test(priority = n) annotation, where n is an integer. TestNG will execute lower priority methods before higher priority ones. java @Test(priority = 1) public void method1() { // Test code } @Test(priority = 2) public void method2() { // Test code } Excluding Test Cases: To exclude test cases, you can use the <exclude> tag inside the <groups> tag in the TestNG.xml file or use the enabled = false parameter in the @Test annotation. Different Annotations: TestNG provides a wide range of annotations for different purposes, including: @BeforeSuite, @AfterSuite @BeforeTest, @AfterTest @BeforeGroups, @AfterGroups @BeforeClass, @AfterClass @BeforeMethod, @AfterMethod @Test Running Test Cases in Parallel: To run test cases in parallel, you can set the parallel attribute in the TestNG.xml file. You can run methods, classes, tests, or instances in parallel. xml <suite name="SuiteName" parallel="methods" thread-count="5"> <test name="TestName"> <classes> <class name="fully.qualified.class.name"/> </classes> </test> </suite> This configuration tells TestNG to run test methods in parallel with up to 5 threads.

Smoke vs regression testing

Smoke Testing: Used as a quick check to ensure the application is ready for detailed testing. It's like checking if a car starts and is ready for a test drive. Regression Testing: Used to ensure that the entire application, after updates or enhancements, remains free of bugs and operates as expected. It's like thoroughly inspecting the car after repairs to ensure everything works perfectly, including areas not directly affected by the repairs. In summary, while smoke testing is a quick, preliminary check to assess the readiness of a software build for further testing, regression testing is a detailed, comprehensive evaluation to ensure that recent changes have not broken any existing functionality. Both play crucial roles in maintaining software quality throughout the development lifecycle.

Examples of application state dependency in tests?

Some radio button is checked by default

How to avoid stale element exceptions?

Stale Element Exceptions occur when an element that was previously located becomes disconnected from the DOM or gets refreshed. To avoid them: Use explicit waits with expected conditions (e.g., ExpectedConditions.elementToBeClickable) to ensure the element is present and interactable before performing actions. Catch the StaleElementReferenceException and re-locate the element using a fresh findElement call if it occurs. Avoid storing WebElement objects for an extended period; re-fetch them as needed. Make sure your tests account for dynamic content and page updates that may affect element references.

Handling OAuth 2.0 in RestAssured

String accessToken = given() .formParam("client_id", "YOUR_CLIENT_ID") .formParam("client_secret", "YOUR_CLIENT_SECRET") .formParam("grant_type", "client_credentials") .post("https://example.com/oauth/token") .then() .extract() .path("access_token"); given() .auth() .oauth2(accessToken) .when() .get("https://example.com/secured/api") .then() .statusCode(200);

Api testing of microservices

Test interactions between microservices. Make requests to one service, capture the response, and then use that response in another service's request if needed.

Test prioritization concept?

Test prioritization is a critical concept in Quality Assurance (QA) that involves determining the order in which tests should be executed based on their importance, risk, and impact on the product. The main goal of test prioritization is to ensure that the most critical parts of the application are tested first to identify and fix major issues early in the development cycle, thereby reducing the risk of product failure and improving the quality of the software.

Working in complex end to end type environment, like in back office teams

Test prioritization is a critical concept in Quality Assurance (QA) that involves determining the order in which tests should be executed based on their importance, risk, and impact on the product. The main goal of test prioritization is to ensure that the most critical parts of the application are tested first to identify and fix major issues early in the development cycle, thereby reducing the risk of product failure and improving the quality of the software.

What is TestNG.xml, difference b/w @BeforeTest and @BeforeMethod?

TestNG.xml is a configuration file used in TestNG to define a suite of tests that you want to run. This file allows you to specify the test classes, groups, methods, parameters, and other configurations that TestNG should execute. It provides a centralized place to manage your tests, making it easier to organize, maintain, and scale your testing suite. Differences between @BeforeTest and @BeforeMethod: @BeforeTest: This annotation is used to specify a method that will be executed before any test method belonging to the classes inside the <test> tag is run in the TestNG.xml file. It is useful for setting up prerequisites for a group of tests at a test level, rather than at a suite or method level. @BeforeMethod: This annotation is used to specify a method that will be executed before each test method. It's useful for setting up prerequisites for each test method individually, such as initializing variables or configuring test environment settings.

DDT in selenium?

Testing data providers or Excel spreadsheets or cucumber table

Why do we check titles of pages in selenium?

That the page we loaded is what we needed, so the end point is set up correctly. To make sure that the page is actually loaded, because in selenium when you use driver.get command it applies some underlining script to check if the Dom is ready and this is how it determines that the page has been loaded but sometimes some elements are not yet available they are triggered by some internal api call and the Dom might be available but the page in fact is not.

What is DOM?

The DOM, or Document Object Model, is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as a hierarchical tree of objects; each object corresponds to a part of the document's structure (e.g., an element, attribute, or piece of text). When a web page is loaded, the browser creates a DOM of the page, which serves as an object-oriented representation of the web page itself. Through the DOM, programming languages like JavaScript can interact with the page, making it possible to dynamically change document structure, style, and content. For example, with the DOM, JavaScript can: - Add, remove, or modify elements and attributes. - Change styles directly, affecting the presentation of elements. - Respond to user actions like clicks or keypresses. - Create dynamic and interactive experiences, such as updating content without reloading the page (AJAX). The DOM is not part of the JavaScript language, but rather a Web API (Application Programming Interface) provided by browsers for JavaScript to interact with. It's standardized by the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG) to ensure consistent behavior across different web browsers.

Why http get method is safe?

The HTTP GET method is considered "safe" in the context of web applications and the HTTP/REST API design. A "safe" method, according to the HTTP specification, is one that does not modify resources; in other words, it does not have any side effects on the server's state. It is used for retrieving data rather than altering it.

What is the Test Pyramid?

The Test Pyramid is a model that suggests the best mix of tests to write for an application. The idea is that you should have more low-level unit tests than high-level end-to-end tests. The pyramid shape is meant to visually convey this idea, with the base of the pyramid being the largest (representing unit tests) and the top being the smallest (representing end-to-end tests).

What does git clone do?

The command creates a copy (or clone) of an existing git repository. Generally, it is used to get a copy of the remote repository to the local repository.

What does the command git config do?

The git config command is a convenient way to set configuration options for defining the behavior of the repository, user information and preferences, git installation-based configurations, and many such things.

What are the benefits of using a test pyramid model instead of writing all your tests as unit tests?

The main benefit of using a test pyramid model is that it allows you to focus your testing efforts on the areas of your code that are most likely to contain bugs. By writing more unit tests for the lower levels of your code and fewer integration tests for the higher levels, you can save time and effort while still ensuring that your code is of high quality.

How can you use the test pyramid model to reduce the number of bugs that make their way into production?

The test pyramid model is a way of thinking about the different types of tests that should be used when developing software. The idea is that there should be more low-level unit tests than higher-level integration tests. This is because unit tests can be run more quickly and cheaply, and they can be used to target specific parts of the code. By having more unit tests, you can find and fix bugs before they make their way into the integration tests and eventually into production.

What are the three things that are most important to you in a job?

The three most important aspects for me in a job are the opportunity for continuous learning, a culture that encourages innovation and creativity, and the ability to work on projects that have a meaningful impact. I thrive in environments where I can constantly challenge myself and grow my skills, where creative solutions are celebrated, and where my work contributes to meaningful change.

What if you cannot execute pre condition of a test case?

Then I try to find a similar test case

What if need to construct element at the runtime because this element is dynamically generated?

Then we cannot use page factory for that element. We will need to have a method for locating this element that will return class By as a return type and we will provide required data as a parameter and this data will be used in for example a css selector.

Is there any advantage to using an inverted test pyramid model? If yes, then what's the best way to implement it?

There can be some advantages to using an inverted test pyramid model, as it can allow for more comprehensive testing at the lower levels. However, it is important to note that this approach can also be more expensive and time-consuming. If you are going to implement an inverted test pyramid model, then it is important to do so in a way that is efficient and effective.

While running a script, you are getting "NoSuchElementException". But you have taken the correct locator(ID, XPATh or CSS). Still you are facing the same issue. What might be the reason?

There could be several reasons for encountering a "NoSuchElementException" even when using the correct locator (e.g., ID, XPath, or CSS): Timing Issue: The web element might not have loaded on the page yet when the script tries to access it. You can use explicit or implicit waits to handle this. Element within an iframe: If the element is inside an iframe, you need to switch to the iframe context using driver.switchTo().frame() before locating the element. Incorrect Page Load: Ensure that the page is fully loaded before attempting to interact with elements. Dynamic Content: The element might be dynamically generated or modified by JavaScript. In such cases, you may need to wait for a specific condition using WebDriverWait. Incorrect Locator: Double-check the locator strategy, spelling, and the element's attributes to make sure it's accurate.

How does Selenium Work?

This is a different question than the previous one, and replace "selenium" with any automation framework you explicitly list on your resume. If you've used a framework, you better know what its doing for you and how it's doing it.

How to achieve Parallel Execution using TestNG?

To achieve parallel execution of test methods using TestNG, you can follow these steps: Annotate your test methods with @Test. Configure the parallel attribute in the TestNG XML suite file to specify the level of parallelism (e.g., parallel="methods"). Run your tests using the TestNG framework. TestNG will automatically execute your test methods in parallel based on the configuration specified in the XML suite file.

How to take the full page screenshot? TakesScreenShot will not take the full page screenshot?

To capture a full page screenshot in Selenium WebDriver, you can use the "Scroll and Stitch" approach. Here are the general steps: Scroll the page to capture the entire content. Take multiple screenshots while scrolling. Stitch the individual screenshots together to create a full page screenshot. You can use libraries like "ScrollShot" or implement your own logic to achieve this. It's a more involved process compared to a single-element screenshot, but it captures the entire page.

Lets say you are testing a service and you make a post call and then the service goes down .. now you want to debug what caused your service to go down so what will be your debugging steps

To debug a service that goes down after a POST call, consider these steps: Check Logs: Review server and application logs for errors or exceptions that occurred around the time of the failure. Reproduce the Issue: Try to reproduce the issue in a controlled environment with detailed logging enabled. Analyze Payload: Examine the payload of the POST request to ensure it meets the expected format and doesn't contain data that could cause a crash (e.g., unexpected characters, sizes). Monitor Resources: Check system and application metrics for unusual resource usage spikes or limits being hit. Dependency Check: Verify if external dependencies or services were accessible and functioning correctly at the time of the issue. Debugging Tools: Utilize debugging tools or features in your IDE to step through the code and identify the exact point of failure.

Handling WebTable with Pagination

To handle a web table with pagination, iterate through the pages by locating the pagination controls. On each page, interact with the table as needed (e.g., reading values, clicking links). This might involve a loop where you check for the existence of a "next" button or page numbers.

How do you learn an application and what matters to test?

To learn an application and understand what matters to test, you start by familiarizing yourself with the application's goals, functionalities, user flows, and architecture. This can be achieved through a combination of: Reviewing Documentation: Begin with product specifications, user manuals, and architecture diagrams to get a high-level understanding of what the application does and how it is structured. Interviewing Stakeholders: Speak with product managers, developers, and end-users to understand the critical features, common user scenarios, and areas where they have experienced issues in the past. Hands-on Exploration: Use the application as an end-user would, exploring all its features and functionalities to identify potential areas of vulnerability or complexity that may require more focused testing. For example, if you're working on an e-commerce platform, you might prioritize testing the checkout process, payment integration, and product search functionality, as these are critical to the user experience and the business's revenue.

The objectives of software testing

To prevent defects by evaluating work products such as requirements, user stories, design, and code. To verify whether all specified requirements have been fulfilled. To check whether the test object is complete and validate if it works as the users and other stakeholders expect. To build confidence in the level of quality of the test object. To find defects and failures thus reducing the level of risk of inadequate software quality. To provide sufficient information to stakeholders to allow them to make informed decisions, especially regarding the level of quality of the test object. To comply with contractual, legal, or regulatory requirements or standards, and/or to verify the test object's compliance with such requirements or standards.

Difference between API and webservice

To put it simply, all Web Services are APIs, but not all APIs are Web Services. Web Services are a subset of APIs that specifically use web technologies for communication.

Verifying Broken Links and Active Links

To verify broken links, send HTTP requests to each link's URL and check the response status code. A status code outside the 200-299 range usually indicates

what are the different exceptions you have seen in UI and Backend ? And then how do you debug that?

UI Exceptions often include: ElementNotVisibleException: Element is present but not visible. Debug by ensuring the element is within the viewport and not obscured. NoSuchElementException: Target element could not be found. Debug by checking the locator strategy and timing issues (element not yet rendered). Backend Exceptions often include: NullPointerException: Attempting to use an object reference that has the null value. Debug by checking object initializations. OutOfMemoryError: The JVM runs out of memory. Debug by analyzing memory usage and leaks. Debugging Approach: Use detailed logs and exception messages to pinpoint the issue. For UI, verify element selectors and wait conditions. For backend, use a profiler for performance issues or inspect code for logical errors.

difference between unit tests and integration tests

Unit Tests: The primary purpose of unit tests is to validate the correctness of individual units of code in isolation, ensuring that they behave as expected and meet the specified requirements. Unit tests help maintain code quality, facilitate code refactoring, and detect regressions early in the development process. Integration Tests: The primary purpose of integration tests is to verify that different units or components of the software work together seamlessly when integrated into larger modules or systems. Integration tests help validate system behavior, identify issues related to component interactions, and ensure the overall functionality and performance of the software.

for sql difference between a merge and a join?

Use Case: JOIN is used for querying data from multiple tables to produce a combined result set, while MERGE is used for updating one table based on the data in another table. Operations: JOIN is purely for selection and does not modify data, whereas MERGE can insert, update, or delete records in a table based on conditions met by the data in another table. In summary, JOIN is used to retrieve and combine information from different tables for queries, while MERGE is a powerful statement for synchronizing two tables by applying changes such as updates, inserts, and deletes.

How to handle dynamic json?

Use Maps or Dictionaries: Instead of deserializing JSON into a static class structure, parse it into a flexible data structure like a map or dictionary, which can accommodate any combination of keys and values. JSON Parsing Libraries: Utilize libraries that support dynamic JSON parsing. For instance, in Java, you can use Jackson or Gson, which allow you to parse JSON into JsonNode objects or JsonObject respectively, enabling you to navigate through the JSON structure dynamically. Path Expressions: Use JSON path expressions to query dynamic JSON structures and extract data without relying on a static schema. Libraries like JsonPath for Java provide a powerful way to search and manipulate dynamic JSON. Custom Deserializers: Implement custom deserializers that can handle the variability in your JSON structure. This approach allows you to encapsulate the logic for handling dynamic parts of your JSON within the deserializer. Type Inference: Some libraries offer type inference capabilities that can automatically map dynamic JSON to appropriate data structures based on the runtime content of the JSON.

How to make tests atomic?

Using api and cookies NEVER USE SELENIUM TO GENERATE APPLICATION STATE FOR PRECONDITION OF THE TEST CASE!!!

should i use body() or create jsponpath object?

Using body() Directly Simplicity: The body() method is straightforward and concise for writing assertions directly within your test methods. It's very readable, especially for simple assertions or when you want to chain multiple conditions together. Inline Assertions: It allows you to perform assertions inline with the request, making it easy to see the request and its expected response side by side. This is particularly useful for simple validation checks directly after making an API call. No Extra Variables: You don't need to declare additional variables to hold the response or parsed JSON, keeping your test code cleaner and more focused on the assertions themselves. given(). // request specifications when(). get("/forecast"). then(). assertThat(). body("days.size()", is(5)). body("days.date", everyItem(notNullValue())). body("days.forecast", everyItem(notNullValue())); Creating a JsonPath Object If your response data needs complex parsing, or if you need to reuse the parsed JSON across several test cases or assertions, extracting the response into a JsonPath object can be more efficient. JsonPath jsonPath = given(). // request specifications when(). get("/forecast"). then(). extract().body().jsonPath(); assertEquals(5, jsonPath.getList("days").size()); assertTrue(jsonPath.getList("days.date").stream().allMatch(Objects::nonNull)); assertTrue(jsonPath.getList("days.forecast").stream().allMatch(Objects::nonNull));

Validation vs verification

Verification is intended to check that a product meets the design specifications. Validation is intended to ensure a product meets the needs of the customer.

Test Scenarios Login Page (15)

Verify that the login screen is having option to enter usemame and password with submit button and option of forgot password Verify that user is able to login with valid username and password Verify that user is not able to login with invalid username and password Verify that validation message gets displayed in case user leaves username or password field as blank Verify that validation message is displayed in case user exceeds the character limit of the user name and password fields Verify that there is reset button to clear the field's text Verify if there is checkbox with label "remember me" in the login page Verify that the password is in the encrypted form when entered Verify that there is limit on the total number of unsuccessful attempts For security point of view, in case of in correct credentials user is displayed the message like incorrect usemame or password" instead of exact message pointing at the field that is incorrect. As message like "incorrect username" will aid hacker in bruteforcing the fields one by one Verify the timeout of the login session Verify if the password can be copy-pasted or not Verify that once logged in, clicking back button doesn't logout user Verify if SQL Injection attacks works on login page Verify if JS injections are possible

How does a browser work?

We build a lot of web based software, and to be a strong automation engineer for web software, you need to know how web software works. I'm not looking for browser-engineer level understanding, but I'd expect you to know how CSS/HTML/Javascript are used to build pages. I'd expect you to know how HTTP is used to fetch resources, and be familiar with other web APIs. I'd like you to understand the different ways web apps can be created... IE what is a SPA or a PWA, or the difference between server side and client side rendering. Other possible questions: "How does the internet work?", "Tell me everything that happens after I type a URL into a browser and hit enter", etc.

How do you test changes in interconnected applications?

We don't have time to test everything but for example if this functionality is directly related to the one in the other application we would check it. Like I said in our clients application they have functionality to register new employee, provide their bank account details, their salary, how many hours they worked, overtime, etc. And then they submit that. And after that we should see this new employee in our internal application. So we would definitely test both apps - 1st one to verify that we can create new employee with all the info that we need and the 2nd one to verify that it has been created in our system as well. Because each application has its own db.

How to rollback changes in the db after each test?

We have a testing a db that automatically refreshes every night, so I don't need to rollback changes. But if I wanted to, I would just write a query to delete what I need. Also we could use Transactional Rollback: For databases that support transactions, you can wrap each test in a transaction and roll it back at the end of the test. This is often the easiest and most effective way to ensure no changes are persisted between tests.

How to collaborate with team members in different time zones?

We have standup meetings early in the mornings so it allows us to have everyone irrespective to their timezone but yes sometimes they have to work in the evenings to catch up with us. If we have a release then they have to work at night. The only exception is holidays. If they have a national holiday then we obviously don't make then to participate but other than that they try to synchronize with us.

What is initElements()?

We need to initialize page objects using initElements() method from PageFactory Class as below, Once we call initElements() method, all elements will get initialized. PageFactory.initElements() static method takes the driver instance of the given class and the class type, and returns a Page Object with its fields fully initialized.

What is @CacheLookup annotation in PageFactory?

We will mark annotation @CacheLookup to WebElements to indicate that it never changes (that is, that the same instance in the DOM will always be used)CacheLookup attribute can be used to instruct the InitElements() method to cache the element once its located and so that it will not be searched over and over again - this is useful when the elements that are always going to be there(For AJAX based applications, it may not work where the DOM changes based on user action on the page). Otherwise every time when we use a Web Element the WebDriver will go and search it again But whenever we use @CacheLookup annotation, we will be losing one of the page factory benefit as it will find the element once and then keep a reference to it, hence, we are more likely to see StaleElementExceptions.

Remote WebDriver vs. WebDriver

WebDriver: WebDriver is a component of Selenium that allows you to automate web browsers for testing and other purposes. It provides a programming interface to interact with web elements and perform actions like clicking, typing, and navigating web pages on a local machine. Remote WebDriver: Remote WebDriver extends the functionality of WebDriver by allowing you to control web browsers running on remote machines or devices. It enables distributed testing, where your test scripts run on one machine (the client) and interact with browsers on another machine (the server). This is useful for cross-browser testing and testing on different operating systems.

what do you do when you find a failing auto test?

Well, first of all given the nature of UI tests that are notorious for being very flaky - In configuration of the project we have a feature to automatically rerun failed tests a couple of times because it might just be the flakiness issue. If however test repeatedly failed, I would look at logs, at screenshots that had been generated during auto execution. I would try to recreate test manually and if that didn't have any problems then I would debug.

Как вы делали автоматизацию в вашем проекте?

When I joined the company they didn't have any automation, then we tried Katalon studio which we didn't like and then we started using selenium. Manual testers were preparing regression suit and automation testers were translating it into code. At first we used bdd with cucumber because for each user story in ms azure we had a bdd style acceptance criteria, so what we did was writing cucumber java scripts and using selenium functional approach to create out test scripts. But later we got rid of cucumber because we just had to spend a lot of extra time writing and maintaining those scripts and the only benefit it provided was that it was written in the same gherkin syntax as user stories. But nobody seemed to care. So we ditched cucumber and started using plain selenium and switched from functional to structural approach to exactly emulate user behavior. For api at first we had a regression and smoke testing suits in Postman and it was pretty advanced with environmental variables and some javascript snippets but obviously it couldn't compete with rest assured or similar frameworks.

When creating test cases, do you manually interact with the app/website after it's built to note button locations in the "test steps" section? How do you handle scenarios where the app/website isn't fully built, but you need to write test cases for specific features?

You can always refer to the requirements. Some agile teams have a UX designer and they design yhe wireframes. You can write the test cases with the help of wireframes I have test case review with dev to make sure we both understood requirements the same way. Also dev has review with UI/UX team I can join as well, and update my test cases/ask questions

How to generate testng.xml dynamically and format of TestNG.xml?

You can generate a TestNG.xml file dynamically using Java code. By creating an instance of the XmlSuite class and adding XmlTest, XmlGroups, XmlClass, and XmlInclude instances to it, you can programmatically define your suite. Once configured, you can use TestNG class instances to set your suite and run it. This approach allows you to create flexible and dynamic test suites based on conditions determined at runtime.

How to read Excel data through hash map?

You can read Excel data into a HashMap in Java using a library like Apache POI. Here's a general outline of how to do it: Open the Excel file using FileInputStream and create an instance of Workbook (HSSFWorkbook or XSSFWorkbook depending on the Excel format). Iterate through the rows and columns of the desired sheet. For each row, create a HashMap where keys represent column headers, and values represent cell values. Add each HashMap to a list or use a HashMap where the row index is the key. Close the Excel file input stream when finished.

If developer says everything works good but you disagree, what do you do?

besides famous situation called "everything works on my machine", I never been in such situation however, occasionally it happens that developers went with a different approach for that feature and in that case I just take a screenshot of their response to me in Teams and later in case there is a problem with my testing I would just tell the manager that this what I was told by developers.

Difference Between getAttribute() and getText()

getAttribute(): Retrieves the value of a web element's attribute. getText(): Retrieves the visible (i.e., not hidden by CSS) inner text of a web element.

Git - Getting the Master Branch into the Current Branch

git checkout master // Switch to the master branch git pull // Update the master branch git checkout your-current-branch // Switch back to your current branch git merge master // Merge the changes from master into your current branch

Differentiate between git pull and git fetch?

git fetch retrieves changes from the remote repository and stores them in your local repository. However, it does not automatically merge or apply these changes to your working directory or current branch, allowing you to review and decide how to integrate changes. git pull combines two operations: git fetch and git merge (or git rebase depending on your configuration). It fetches changes from the remote repository and immediately tries to integrate them into your current working branch. It effectively updates your working directory with the remote changes.

Can you tell the differences between git revert and git reset?

git revert creates new commits to undo changes while preserving commit history, making it safe for collaborative workflows. git reset moves the branch pointer and can rewrite commit history, making it powerful but potentially disruptive, and it should be used with caution, primarily for local branches.

Tell me something about git stash?

git stash is a useful Git command that allows you to temporarily save changes that you are working on in your working directory but do not want to commit immediately. It is particularly helpful when you need to switch branches or work on something else without committing your current changes. The git stash command essentially creates a "stash," which is a stack of saved changes that you can later apply or pop when needed. Git stash can be used in cases where we need to switch in between branches and at the same time not wanting to lose edits in the current branch. Running the git stash command basically pushes the current working directory state and index to the stack for future use and thereby providing a clean working directory for other tasks.

How do you handle asynchronous loads on a page?

use explicit waits.

Задачи автоматизации?

Автоматизация рутинных и частых проверок, снижение нагрузки на QA специалистов. Контроль основных функций приложения и отслеживание изменений в продукте. Возможность проводить тестирование с большим количеством устройств, версий браузеров и операционных систем. Тестирование производительности приложения в условиях одновременной работы с большим количеством данных и пользователей.

Agile, waterfall, scrum:

В Waterfall все жестко, а в Agile можно что то на ходу поменять, типа окей эту историю мы делаем в следующий раз. Scrum это подмножество agile, там много очень коммуникации между членами команды и задачи меняются чуть ли не ежедневно, то есть это прям очень гибкий вариант agile.

Вы писали «Для автоматизации SDET инженеры выбирают ключевые, часто используемые сценарии работы пользователя с продуктом» — можете подсказать, на основе чего идет выбор сценариев для автоматизации, берутся частые баги из трекера, берутся строгие сценарии из документации, либо происходит еще какое-то внутреннее согласование с аналитиками проекта/ручными тестировщиками?

В первую очередь выбираем самые часто используемые сценарии использования со стороны пользователей (например — авторизация, добавление товара в корзину), затем идут сложные (для воспроизведения) или длительные (по времени выполнения) сценарии, и так далее. Приоритеты выставляем по согласованию со специалистами QA, тимлидом, project manager.

Кто отвечает за релиз?

Вообще вся команда. Но есть специальный человек который запускает все это дело. Сначала запускает синюю сторону, мы ее тестируем, потом зелёную сторону. Вот у мамы подробнее про это все спросить и попросить показать эти стороны.

Regression testing suit - как определять что туда включать?

Все основные фичи должны быть протестированы.

Что делать если нашёл критический баг? Откладывать ли релиз?

Главное сообщить проджект менеджеру. Вообще да, релиз могут и отложить, но это решение принимает проджект менеджер, а не тестировщик. У меня был случай когда мы нашли критический баг через несколько минут после релиза. Тогда мы все дружно кинулись его фиксить в надежде что юзеры не заметят. А общее правило действий при нахождении крит бага состоит в том чтобы немедленно добавить в чат (сначала мы использовали slack, потом перешли на Microsoft teams) всех причастных к этому багу и как я сказал - обязательно уведомить проджект менеджера.

Как у вас происходят релизы?

Делает devops инженер. В 6 утра все причастные в системе инвайтятся на релиз. Обычно из qa присутствует 1 человек. Все подсоединяются к MS teams, только при релизе в отличие от обычных митингов мы пользуемся не звонками, а только чатом. И devops и запускает blue side и я начинаю делать smoke testing (этот тестинг делается за 5 минут). Потом green side и мы точно так же тестируем green side. А потом все друг друга поздравляют. На все про все уходит 20 минут. Важный момент: перед началом релиза нужно зайти в продакшн и посмотреть работает ли он вообще. У нас такого не бывало ещё, но я на всякий случай всегда проверяю то есть делаю log in и log out. Подробнее про blue green deployment https://www.redhat.com/en/topics/devops/what-is-blue-green-deployment

Какие вы используете среды запуска тестов, например тестирование в облаке, тестирование в докер контейнерах. Как при этом выглядит кроссплатформенное и кроссбраузерное тестирование?

Для запуска тестов мы используем и различные тестовые окружения-стенды, и докер-контейнеры. Кроссплатформенность можно реализовать через разведение по различным окружениям, а кроссбраузерность — на уровне кода автотестов с использованием параметризации, либо с использованием контейнеров.

А когда в системе девелопер отметил что баг исправлен, ты проверяешь что его действительно исправили? И как ты проверяешь что пока исправляли этот баг не внесли новый?

Естественно проверяю. И проверяю сопутствующие/взаимосвязанные элементы. Например если баг состоял в том что при нажатии на кнопку назад тебя переносит не на ту страницу, то я после исправления ещё кнопку вперёд проверю, потому что запросто может быть что пока девелоперы чинили кнопку назад они сломали кнопку вперёд.

Спросить есть ли у них бизнес аналитики и кто составляет user stories?

Есть, но я с ними не взаимодействовал, с ними общается проджект менеджер и он же составляет user stories.

Бывают ли баги в документации?

Ещё как! Бывают что user stories написаны как попало. Мы делаем stories review на митингах, но если до митинга я успел увидеть что в стори что то не так, то я менеджеру заранее сообщаю, может он успеет исправить до митинга, чтобы потом на митинге не тратить на это время.

Какие тесты нужно автоматизировать в первую очередь?

Зависит от особенностей конкретного продукта. Большинство компаний автоматизируют smoke тесты и регрессионные тесты для проверки уже готовых функциональностей

Regression testing in agile

Каждый раз после крупного изменения в проекте, например когда api меняется даже если ui остается тем же самым, чтобы убедиться что все работает. Но вообще когда PM сказал, что надо бы сделать regression testing, мы делаем. Нас еще постоянно спрашивают - а сколько времени это займет? Это вообще очень интересный вопрос, в идеале regression testing должен быть быстренько сделан и можно идти дальше, но на деле такого на моей практике не было еще ни разу, потому что это зависит от того сколько багов полезет, а лезут они всегда. Дальше все зависит от того как быстро их починят и не наделают ли девелоперы новых багов пока будут чинить старые. У нас нередки случаи когда это занимает по несколько недель - и это с учетом автоматизации! Кстати когда девелоперы фиксят баги они еще меняют ui/api и забывают нам об этом сказать и у нас авто тесты начинают падать и нам в дополнение к самому regression testing еще нужно теперь update auto tests.

Подробнее спросить про проджект менеджеров. Типа почему у них несколько проджект менеджеров и вообще вот всю эту внутреннюю структуру компании?

Команды по проектам разделены. На одном проекте может быть несколько проджект менеджеров. В команду входят девелоперы, qa, проджект менеджеры. С дизайнерами QA взаимодействует например история не совпадает с макетом, или можно сказать что нечитабельно. Или что то ещё.

Когда автоматизация обязательна?

Масштабное приложение с большим количеством бизнес-функций Значительный срок жизни приложения (от 1 года и более) Внедрение CI/CD, регулярные релизы + небольшое количество QA специалистов У вас проект длительностью в год или больше. Количество тестов, которые нужно прогонять в рамках регрессии, стремительно растет, а рутину нужно искоренять в первую очередь. Тестировщики должны тестировать, а не проходить тест-кейсы. У вас распределенная команда разработки либо в команде больше двух разработчиков. Разработчик должен быть уверен, что его изменения не сломают чужой код. Без авто-тестов он узнает об этом в лучшем случае через день-два, в худшем — от пользователей. Вы поддерживаете несколько версий продукта и выпускаете патчи и сервиспаки под каждую из них. Тут все очевидно: тестирование на разных конфигурациях — это рутина, а рутину надо искоренять. Вы разрабатываете сервис, основная задача которого — обработка и трансформация всевозможных данных. Заниматься ручным вбиванием в систему данных и визуа

А ты пишешь кейс и сразу автоматизируешь?

Нет конечно. Какой смысл автоматизировать нестабильный проект? Может там ещё все 10 раз поменяется. Автоматизируют всегда только стабильные части приложения.

How to handle a situation when pages have a lot of common elements? Should we put them all in the base page class?

Нет, потому что тогда наш базовый класс станет огромным, надо выделать компоненты в отдельные классы, прописывать там всю логику работы с ними и в page objects уже использовать их как поля класса. Это кстати хороший пример про конфликт разных principles, типа выбрать dry или kiss или srp, потому что в данном случае они все взаимоисключающие.

Что делать если вы пропустили баг?

Ну поскольку я его пропустил то я о его существовании и не знаю, когда обнаружу тогда и зарепорчу.

Спросить какие у них были сложные ситуации и как они их преодолевали?

Ну сложно было когда весь проект перевели на новый интерфейс и баги полезли изо всех щелей. Сначала его девелоперы у себя локально 2 месяца делали, а потом делали pull request в development environment. В один спринт все это потом релизили и мы очень много работали. ТОЛЬКО НЕ СКАЖИ ЧТО ТЫ К ДЕВЕЛОПЕРАМ ТАМ ЛИЧНО ПОДХОДИЛ ПОМНИ - ТЫ РАБОТАЛ УДАЛЕННО В ДРУГОМ ШТАТЕ

А как узнать кто причастен?

Ну у нас истории привязаны к командам девелоперов, так что я сразу всю команду отмечаю и проджект менеджера. Это все делается в Azure. Бывает что девелопер мне говорит ты если баг нашёл в этом месте сразу на меня отмечай, я за эту часть кода отвечаю, обычно это происходит после того как я уже нашёл там один баг и зарепортил. Но вообще это не наша работа assign bug to someone, это задача их менеджера определять кто и что будет чинить. Мы обычно отмечаем всю команду и проджект менеджера.

Комплексный подход к автоматизации тестирования?

Общая рекомендация тут одна: нужно иметь все виды авто-тестов в нужном количестве на каждом из уровней. Тогда появляется возможность получать эффективную отдачу от таких тестов. На уровень API-тестов нужно опускать все функциональные тесты, которые тестировщики проводили на протяжении спринта. Негативные, позитивные, комбинаторные и т.п. Тем самым создается быстрый и стабильный пакет регрессионных тестов. На уровень UI-тестов выносятся исключительно приемочные тесты, так называемые Happy Path или End-To-End сценарии, которые показываются во время демо. Это относится как к веб-, так и к мобильным приложениям. Итого, если просто следовать рекомендациям пирамиды, то можно получить очень быстрые тесты и отличное покрытие при сохранении вменяемой стоимости разработки и поддержки.

Сколько тест кейсов на историю?

Обычно 1 тест кейс на 1 историю, потому что истории маленькие. Если история большая то её обычно делят на несколько маленьких.

Сколько суммарно человек в их команде?

От 10 до 30, по разному - люди приходят, уходят, переводятся в другую команду

Что делать если тебя перекидывают с проекта на проект и например ты на этом проекте не работал несколько месяцев, как ты узнаешь что там изменилось, как теперь все работает и тд?

Посмотрю, потыкаюсь. Подниму user stories. Но такого, чтобы были прямо какие-то глобальные изменения не было. У нас ведь все проекты довольно старые, там просто что то добавляют, меняют и тд, но такого как в стартапах, что за полгода продукт разросся в несколько раз не бывает.

Трудные моменты с работы/автоматизации:

Работа с Эксель файлами. Учитывая специфику нашего софта - бухгалтерия, мы многие тестовые данные храним в формате экселя и библиотека apache poi которая нужна для удобной работы с Экселем в селениуме имеет свои особенности, например число 12345 она прочитает как 12345.0 даже если в самом Эксель файле тип данных указан как текст. Flaky UI tests Consistency, keeping names and usage consistent throughout the project and constant refactoring and tweaking of flaky tests. Finding bugs with the automation and the seeing the bug sit there for weeks and having to remind them that the testing caught it, and that they should fix it. Bonus points for when someone says "When did this bug get caught. It wasn't doing that before, we'd have noticed." Also having it throw off your runs, either because you remove it until the test can pass (lowering your coverage), or you have a big red failure that everyone asks about (why is it not passing at 100%). One of my biggest difficulties is making sure that the coverage is good. With unit tests there are a number of tools to evaluate coverage, with E2E/ UI/Integration tests, not so much. It's hard to see what coverage is there and what needs to be improved and understand what's missing, especially on a set of tests that have been running for a year or more.

Спросить у мамы как часто у них билды и релизы?

Раз в 3 недели релиз - потому что спринт 3 недели. После начала спринта мы в Azure смотрим story board и как только там что то появляются мы это тестируем.

Experience working in multi-dimensional teams and having to coordinate with large group of people?

Рассказать мамину историю про супер главного бухгалтера которая с ними митинги проводит.

Как тестировать если в azure не прописаны acceptance criteria для истории?

Смотреть на саму историю, на ее название, на худой конец спрашивать

Как вы делаете usability testing?

Так чтобы специально именно тестировать usability мы не делали. Но ты же когда тестируешь ты же все равно видишь что например текст нечитабельный или drop down слишком короткий - видно только одну строчку например, а удобно было бы чтобы он нормально был виден.

Откуда вы берёте требования для тестирования? Тестировали ли вы продукт без требований?

У нас есть user stories. Их составляет project manager, на основании того что ему говорят business people. Такого чтобы не было user stories у нас не было. Так что без требований/документации я ни разу не тестировал.

О unit тестах, как и в каком объеме они у вас используются, и влияют ли на конечное количество сценариев UI и API тестов?

Чаще всего unit-тесты пишут и сопровождают разработчики. Специалисты направления SDET не разрабатывают и не используют в процессах автоматизации тестирования unit-тесты, реализуя независимое тестирование. Мы ничего про то что там в этом плане происходит у разработчиков не знаем и пишем свои тесты самостоятельно.

Что делать в отсутствии документации или когда нужно быстро разобраться в приложении где ты не с начала его создание начал над ним работать?

Я буду спрашивать девелоперов. Я это называю playing hot potato with the developers because they keep forwarding you from one to another when you ask them specific questions.

Tell me a about interesting bug you found?

история про штат Orergon типа это keyword in SQL

Почему автоматизация только UI-тестов — зло?

— UI-тесты нестабильны; — UI-тесты медленные.


Set pelajaran terkait

periodic table of elements 30-60

View Set

MED SURG NCLEX RESPIRATORY REVIEW

View Set

vue模板书写以及生命周期

View Set

Last Poccia Review Test (Jan 2017 - Jun 2015)

View Set