QA set 1
What is an arrayList? Give an example of an array
//declare and define an array list of countries ArrayList<String> country = new ArrayList<>(); //add values for countries country.add("USA"); country.add("BANGLADESH"); country.add("CHINA"); country.add("ECUADOR");
How do we switch between tabs?
//since new tab is opened, define tabs and store the values ArrayList<String> tabs = new ArrayList<>(driver.getWindowHandles()); //switch to new tab driver.switchTo().window(tabs.get(1));
How often did you perform smoke testing?
We usually perform smoke testing at the beginning of a new sprint to test the major functionality of the software.
How can I upload a file on a page? hint: usually in some sites you might see an upload button that opens up another window to upload a file to be attached
You can upload a file via mouse commands using send keys to put the path in.
How do you erase/remove a data in API?
You can use the http DELETE method.
How can I execute multiple test classes as a suite using xml file in selenium?
You create an xml file containing the suite name and list the test classes you want to use in your test suite.
What is Boolean? Give example.
A Boolean is a true or false, 1 is true, 0 is false.
What is HashMap? Look into an example of HashMap.
A HashMap is a data structure that is used to map data.
What is split? Show a brief example.
A split takes a string input and separates that string input into a Linear array ( String[ ] ) dividing it by some string parameter such as a slash, space bar, or anything for that matter. It can also be given a limit as a second parameter.
What is the difference between void and return method? Show one example of a reusable method either void or return...
A void method executes the code and does not require a return type. Whereas a return method has to return the variable.
What is API testing?
API testing is testing that validates an API or APIs.
How many ways we can handle exceptions?
Hard Soft Try-Catch Blocks: Exceptions can be caught and handled by enclosing the code that may throw an exception within a try block and providing a corresponding catch block to handle the exception. The "throws" Clause: A method can indicate that it throws an exception by including a "throws" clause in its method signature, and it is the responsibility of the caller of the method to handle the exception. The "throws" Statement: The "throw" statement can be used to throw an exception explicitly. The "finally" Block: A finally block can be included after a try-catch block to provide code that will be executed whether or not an exception is thrown.
What is the difference between soft assert & hard assert? Show syntax for soft assert.
Hard assert throws an exception immediately when an assert fails and continues to the next @test in the test suite. Soft assert does not throw an exception when an error occurs and contains the current @test.
How can you handle windows-based pop up?
In Selenium, you can handle windows-based pop-ups by switching the focus of the web driver to the pop-up window. This can be done by using the switchTo() method provided by the org.openqa.selenium.WebDriver class and passing the handle of the pop-up window to it.
What is method overload?
Method overloading is when you can use the same method in java with different inputs twice or more in the same class. As long as the inputs are different each time the method is called in the same class.
What method is used to estimate sprint story points?
Method: Fibonacci Sequence Fibonacci Sequence Numbers: 1, 2, 3, 5, 8, 13 etc. Usage: Every user story will get a story point based on the Fibonacci sequence. The higher the story point, the more complex the user story is.
Why was your role important? How did you add value to your team? What made you a good QA?
My role was important because I made sure that the quality of the software was good before each sprint ended. That allowed for mistakes to be caught early, which saves the company money in the long run. I was a good QA because I was attentive to details and I would follow the steps of the product log accurately.
How many stories does your team complete per sprint?
My team and I completed roughly 5-15 stories per sprint.
What is the difference between put and patch method?
Put: Replaces some resource Patch: Updates some resource
What is a payload?
The payload is the data contained within a request.
How do I launch the browser using WebDriver?
Webdriver driver = new ChromeDriver();
How do you build software using agile methodology?
You build software in an iterative fashion. Agile drives software developers to deliver value in small increments and implement continuous feedback.
How can I perform cross browser testing using xml file in selenium?
You can create a testng.xml file with the desired browsers and browser versions, similar to setting dependencies in your pom.xml file
How can you switch to a web page frame on a web page?
driver.switchTo.frame()
What is the difference between findElement vs findElements?
findElement locates an element by its property and value (Unique Syntax). findElements locates an array of elements where some elements have the same exact class, properties, and values so we can identify specific elements of the same group by index starting from 0.
What is loop? Show a syntax of a loop
for (i=0, i<=x, i++); System.out.println(i);
What is the difference between "/" and "//" in Xpath?
"/" is used to create Absolute Xpaths. "//" is used to create Relative Xpaths
Show the expression of how to define the following properties in xpath if I want to use more than one property to identify an element. Href="abcd123", value="myPayment"
("//*[@href='abcd123' or @value='myPayment']");
How can I capture a property value from an element? Hint: not getText it is another method similar to that.
.getAttribute() method
Show syntax of how to capture a text from a web page...
.gettext()
Show syntax of how to enter a string into an input/text field...
.sendkeys()
How can we execute test cases using testNg? Show an example including the annotation
@test public void someThing()
What is class in Java?
A class is a file in Java is where you write your code via an IDE. A class contains primitive data types and methods.
What is a method in Java? give example
A method is a collection of code that executes when called upon. It can either have a return type or be void.
What is page object model framework in selenium webdriver?
A page model framework is a way to store web elements to their respective class or page. It helps increase productivity through good organizations + helps maintenance.
What is the difference between static and non-static method?
A static method cannot be changed and therefore it is able to be called again. A non-static method can be changed and therefore it is dangerous for it to be called in different parts of code because if that original non static method was changed, it would result in a lot of changes and probably cause bugs.
What is the difference between absolute & relative Xpath?
Absolute xpath is the absolute path to a web element, if anything is changed to the root of the path, the absolute path can become an invalid xpath. Relative xpath is not absolute and therefore preferred.
What is an endpoint?
An endpoint is one end of a communication channel.
What is appium mobile testing in Selenium?
Appium mobile testing is a mobile app emulator that allows you to test on mobile applications.
Can captcha be automated?
As far as I know, it cannot. However usually in a testing environment, captcha will not be active.
What is BDD?
BDD stands for Behavior Driven Development. BDD helps communication between technical teams and Business teams. BDD process generates a common documentation that can be understood by all teams and stakeholders. BDD has 3 phases: 1. Discovery: Which discusses how the system should behave. 2. Formulation: Which creates concrete examples that can be automated for example Acceptance Tests. 3. Automation: Code Implementation and Automation Tests.
What is constructor in java?
Constructor in java is used to create the instance of the class. Constructors are almost similar to methods except for two things 1. its name is the same as the class name and 2. it has no return type.
What is data driven testing in Automation? Briefly explain how data driven concept is done using JXL(.xls)
Data driven testing in Automation is using some test with values from a file or database rather than having hard coded values because using hard coded values would be difficult to maintain in a script. JXL is an API that integrates Java and Excel to allow for Data driven testing using Excel which is a common database software.
What is the benefit of using reusable methods from a class?
Efficient code reuse. Reducing the amount of code that needs to be written and making it easier to maintain. It also makes the code more organized and readable, making it easier to understand and troubleshoot.
What is exception in java?
Exception in java is an event that occurs during the execution of the code that disrupts the normal flow of instructions. When exceptions are thrown, the Java runtime system will look for a block of code that can handle the exception, such as a try-catch block. If no such thing is found, the program will end.
Tell me about yourself.
Hi, my name is Maisey and I'm a QA Automation Engineer. I'm currently working on testing the part of our website that deals with navigating the user to find a Health Insurance plan that best suits them. I've been employed here since the summer of 2019, so a little over 3+ years. I started in Manual Testing and I learned some python on Code Academy and I enjoyed it, I then learned Java and asked my QA Lead if I could try automation. In 2020 I got promoted to Automation QA. United Healthcare follows a scrum agile methodology. We work in 2 week sprints.
Where do you see yourself in the next 3 to 5 years?
Hopefully I will learn more skills in QA and Automation. Otherwise, I will remain a QA because I love it and I don't think I'll change anytime soon.
How do we select what to be automated? Automation Candidate Selection? Explain
How: We select what to be automated when the tasks given are repetitive, time-consuming, and subject to human error. Automation Candidate Selection Definition: The process of identifying which parts of a software application are suitable for automation testing.
How did you get into the QA career? What made you want to become a QA? *********
I got into QA by chance, I had a friend who worked in QA and told me that it's a good job and I just decided to apply for jobs. I quickly discovered that I enjoyed the attention to details and I find it very fulfilling to ensure the quality of software products.
What is Java?
Java is an object oriented programming language. It can run on Java Runtime Environment.
What are the advantages of API testing?
Language Independent: API testing can be performed using any programming language, which means that developers can write test cases in a language that they are comfortable with. Speed: API testing is faster than GUI testing as it does not involve the overhead of loading a user interface. Reduced Cost: API testing can reduce the overall cost of testing as it allows for testing the functionality of the system at an early stage of development. Improved Reliability: API testing allows for more thorough testing of the functionality of a system, which can improve the reliability of the overall system. Better Isolation: API testing can better isolate the system under test from the dependencies, which can make it easier to identify and fix defects. Better Test Coverage: API testing can provide better test coverage than GUI testing, as it allows for testing the functionality of the system at a lower level. Ease of Integration: API testing can be easily integrated with other tools such as Continuous Integration (CI) and Continuous Deployment (CD) pipelines. Ease of Automation: API testing can be easily automated, which allows for efficient and consistent testing. Better Security Testing: API testing can provide better security testing than GUI testing, as it allows for testing the security of the system at a lower level.
What are the different types of frameworks?
Linear Automation Framework Modular Based Testing Framework Library Architecture Testing Framework Data-Driven Framework Keyword-Driven Framework Hybrid Testing Framework
What is the purpose of creating a project as maven?
Maven is great at implementing dependencies since all you have to do is add them to your pom.xml file.
Tell me about your most recent project?
My most recent project was about allowing users to search for healthcare providers and pharmacies through the "Find a Doctor or Pharmacy" tab on the United Healthcare Website. Doctors Dentists
What are some of the methods in api? Give example of each.
Post: Creates some resource Put: Replaces some resource Patch: Updates some resource Get: Gets some resource Delete: Deletes some resource Resource in APIs is an object with a type, associated data, relationships to other resources, and a set of methods that operate on it.
What do you do when you find an issue that is a showstopper?
Report the issue to the development team as soon as possible (The tester should provide a clear and detailed description of the issue, including any steps that were taken to reproduce it). Prioritize the issue for immediate resolution (Showstopper issues are typically considered to be the most critical defects in the software and should be given the highest priority for resolution). Work with the development team to resolve the issue (The tester may be asked to provide additional information or to help troubleshoot the issue. They should also work with the team to identify a solution and to ensure that the issue is properly fixed). Update the issue tracking system (The tester should update the issue tracking system to reflect the status of the issue and any steps that were taken to resolve it). Retest the issue to confirm that it has been resolved (Once the issue has been fixed, the tester should retest the software to confirm that the issue has been resolved and that the software is functioning correctly).
Explain to me what is SDLC?
SDLC is the Software Development Life Cycle. It has 7 phases. IRDDTDM: Ideation: Brainstorming the software, thinking of how to create architect the product. Requirements: Creating the product backlog and defining what 'Done' means. Design: Creating the architect of the product. A more in depth and more technical way of creating a plan for the software. Development: Developing the product itself. Programming the software. Testing: Testing the software, making sure that there are no bugs. As well as ensuring that the software passes the definition of 'Done' Deployment: Deploying the software out to the market. Maintenance: Updating the software after the software is released into the market. Taking criticism from costumers/users.
How do you get a current url from a page? hint: you can store the url in a variable and let say if you want to re navigate to that specific url then you can just pass the variable on your navigate command.
String currentURL = driver.getCurrentUrl();
What tools are you familiar with? What did you use for what purposes?
Test NG Selenium GitHub API's
What are the scrum ceremonies? What was your involvement? ******
The Scrum Ceremonies are: Sprint Planning Meeting Daily Standup Sprint Review Meetup Sprint Retrospective
What is the process called when I call one method from a class to another class?
The process of calling a method from one class to another class is called method invocation or method call.
How can I extend one class to another class? What happens when I extend a class within another class?
We can use extends to extend one class to another. It acquires all the properties and behaviors of the parent class.
How many team members did you have on your team? Did you have any offshore team?
We have 4 developers and 1 lead. 3 Quality Assurance engineers, 1 was manual, 1 was QA lead. Me and another person are automation and manual. I did not work with any offshore team so far.
What kind of environment did you work in?
We work in an Agile Scrum environment and had daily stand ups to ensure that we were meeting our goals and staying on track.
How can I store a locator into a variable? Show syntax. Let say element name=abc...
WebElement locatorVariable = driver.findElement(By.name("abc"));
How can I hover over an element? Show syntax
Webdriverwait wait = new Webdriverwait(driver,15); Element=wait.until(ExpectedConditions.visibilityOf(Xpath)); ---- Actions action = new Actions(driver); webElement X = actions.movetoElement(X).perform();
Let say I have an element which has property of class="navgroup" but there are multiple elements with same class name. I want to click on second element within that group so show me syntax of how can I locate the second element of that group
Webelement second = driver.findelements(by.xpath("//*@class='navgroup']").get(1);
What are some of the status codes in api?
200: Status Ok: The request was successfully completed 201: Status Created: A new resource was successfully created. 400: Status Bad Request: The request was invalid. 401: Status: Unauthorized: The request did not include an authentication token or the authentication token was expired. 403: Status: Forbidden: The client did not have permission to access the requested resource. 404: Status: Not Found: The requested resource was not found. 405: Status: Method Not Allowed: The HTTP method in the request was not supported by the resource. 409: Status: Conflict: The requested could not be completed due to a conflict. 500: Status: Internal Server Error: The request was not completed due to an internal error on the server side. 503: Status: Service Unavailable: The server was unavailable.
How many ways can I select an element from a dropdown using select command?
3 ways, selectByIndex selectByValue selectByVisibleText
What are the annotations you have used in testNG? Also, briefly explain what is the purpose of using each one.
@BeforeSuite: Will be run before all tests in the suite have run. This is where we would set the driver. @BeforeMethod: Will be run before each test method. This is where we would capture the test name. @AfterSuite: Will be run after all tests in the suite have run. This is where we would quit the driver. @AfterMethod: Will be run after each test method. This is where we send logs for html reports on each test. @Test: A part of the test case.
What is conditional statement? Show the syntax for a conditional statement.
A conditional statement is a statement of code that executes if a certain Boolean condition is met. If x>3; System.out.println("x is greater than 3").
What is the difference between API testing and web UI testing?
API testing tests the API. Web UI Testing tests the Web UI.
What is an array list? Give one example using Array list
ArrayLists are variable length data structure. Which means that the list can be changed and updated. The syntax of an ArrayList is as follows: ArrayList<String> name = new ArrayList<>(); name.add("Maisey"); name.add("Sumon"); name.add("Zakir");
What is ChromeOptions?
ChromeOptions is a set of arguments that you can import while using Selenium and a Google Web driver to perform certain actions such as: Start maximized, start in Incognito.
How can I get the count of multiple links within same class group? Show the full syntax..
Driver.Findwebelements(by.xpath("//*[@class='group']").size();
How can I locate an element using cssSelector? hint: best choice is by.Xpath but still look into by.cssSelector.
Driver.findelement(by.cssselector("input[name='test']")
Can WebDriver test Mobile applications?
If you use Appium, then yes.
What is implicit vs explicit wait? Show syntax for both.
Implicit waits are waiting periods between each step/command across the entire test script whereas explicit wait, waits for a condition to be met in some amount of time Driver.manager.implicitWait(10,TimeUnit.seconds);
If I want to verify a page title from a webpage which assert command can I use? Show example.
In Selenium, you can use the assertEquals() method from the org.junit.Assert class to verify the page title of a web page. The assertEquals() method takes two arguments: the expected value and the actual value. Here is an example of how to use this method to verify the page title: String expectedTitle = "Expected Title"; String actualTitle = driver.getTitle(); assertEquals(expectedTitle, actualTitle);
What is javascriptExecutor? How can I scroll using JavascriptExecutor? Show syntax for all scrolling.
JavascriptExecutor is an interface that allows us to interact with html web elements. JavascriptExecutor J = (JavascriptExecutor) driver; j.execute Script ("window.Scrollby(0,250).", ""); or scroll into view
What is Jenkins continuous integration with selenium? Look into it. It's good to have basic knowledge on it.
Jenkins is an open-source DevOps tool that is commonly used for continuous integration and continuous delivery processes[1]. It is a Java-based application and platform-independent. Jenkins is primarily used as a build tool to run builds from the source code repository, execute unit tests, and send build reports to team members[1]. When it comes to integrating Jenkins with Selenium, there are several advantages for developers in terms of continuous integration and testing[2]. By setting up a Selenium-Jenkins task, you can automate the execution of Selenium tests and achieve the following benefits: Continuous Integration: Jenkins allows you to automate the execution of Selenium tests as part of your continuous integration process. This ensures that your tests are executed regularly and any failures or issues are identified early in the development cycle[2]. Scalability: Jenkins provides the ability to distribute your Selenium tests across multiple machines, enabling parallel execution and faster test cycles[2]. Reporting and Notifications: Jenkins offers various plugins and integrations to generate detailed test reports and send notifications to team members or stakeholders when tests fail or encounter issues[1][3]. Integration with Source Control: Jenkins can be integrated with source control systems like Git or SVN, allowing you to trigger Selenium tests automatically whenever changes are pushed to the repository[3]. Flexibility: Jenkins supports a wide range of plugins and tools, allowing you to customize and extend its functionality to suit your specific testing requirements[3].
What are the best practices of reporting a bug?
Reproduce the bug two times before writing a bug report ask a peer Test the same bug occurrence on other similar modules, systems, data, or environments. Report the bug immediately Write informative summary Very detailed step by step description Use diplomatic language Properly define severity and priority Read bug report before hitting submit button
How can I verify if a checkbox is selected or not?
Set the checkbox to a web element. Call isSelected(); It returns a Boolean. 1 if selected, 0 if not.
Can you give me an example of what you contributed to during the scrum ceremonies?
Sprint Planning Daily Stand-up Sprint Review Sprint Retrospective
What was your role during UAT?
UAT: User Acceptance Testing UAT Definition: Testing that is performed to ensure that a software application or feature meets the needs and expectations of the user. UAT Extra Information: Performed by the user or customer. The goal of UAT is to ensure that the software is fit for purpose and meets the user's acceptance criteria. QA Role During UAT: Ensure that the testing is conducted efficiently and effectively, and provide support and assistance to the user as needed. Specific responsibilities may include... Helping the user understand the testing process and how to use the testing tools and techniques. Assisting the user in the creation of test cases and test scripts, if necessary. Coordinating with the development team to resolve any issues or defects that are identified during testing. Tracking and managing the progress of the testing, including the status of any defects or issues that are identified. Providing regular updates and reports on the progress of the testing to the relevant stakeholders.
What is Xpath contains?
Xpath contains is an xpath method that is able to locate an element with partial text.
Can post method be used to also update API data?
Yes, you can use post method to update API data but it is not recommended.
How can I tell testNG to run @Test methods in sequence? Basically, how do I set the priority for @Test annotation in testing
You assign priorities to each @Test Method by setting the priority = to some number ie: public class MyTest { @Test(priority = 1) public void testMethod1() { } }
How can I scroll into an element? Describe the process briefly.
You use JavaScript Executor and you execute an argument to scroll into view with CSS commands to decide how you want to view it and then you also enter the web element in the parameter.
How can I click or type in a textbox using mouse movement? Explain
action.moveToElement(X).perform(); or action.moveToElement(X).sendkeys("XYZ");
How do we click on a hyper link using linkText?
driver.findElement(By.linkText("linkTextExample")).click();
Let say I have a button which has a property value of title=myButton. Use Xpath syntax to locate this element and click on it...
driver.findElement(By.xpath("//*[@title='myButton']")).click();
How can I get a title of a page?
driver.gettitle();
How can I delete all cookies from a page? What's the syntax for it?
driver.manage().deleteAllCookies();
Why was your project important in the company?
edit this answer to include an answer
What is the difference between quit() vs close()?
quit() quits the webdriver completely whereas close() closes the tab open. If there is only one tab open, close() will close the website completely.