Table of Contents
Accenture QA interview questions
1. Which versions of Selenium, Appium and Java are you using in your project?
I am using these versions in my project
Selenium – 3
Appium – 4
Java – 8
2. What are different waits available in selenium?
There are two types of wait
Implicit Wait :Used for providing a default waiting time between each successive test step or command across the entire test script.
Explicit Wait :Used for halting the execution until the occurrence of a particular condition or till the elapsing of the maximum time. Applied for a particular instance only.
3. What is the use of Thread.sleep() method in selenium?
If you use Thread. sleep while performing Selenium test automation, it will stop the execution of the script for the time specified in the script, irrespective of the fact that the element on the web page has been found.
4. How you will select iFrames from multiple iFrames? How to switch from in between iFrames?
Select iframe by id
driver.switchTo().frame(“ID of the frame“);
Locating iframe using tagName
driver.switchTo().frame(driver.findElements(By.tagName(“iframe”).get(0));
Locating iframe using index
frame(index)
driver.switchTo().frame(0);
frame(Name of Frame)
driver.switchTo().frame(“name of the frame”);
frame(WebElement element)
Select Parent Window
driver.switchTo().defaultContent(); {this is used to come back on html element}
we can switch over the elements in frames using 3 ways.
- By Index
- By Name or Id
- By Web Element
5. What is the default server and port number of Appium?
The default server port is 4723.
6. Tell me about the frameworks used in your project?
I have used Selenium WebDriver, TestNG, Rest Assured and Cucumber.
7. What are Action and Select class? When to use them?
Action Class :Actions class is an ability provided by Selenium for handling keyboard and mouse events. In Selenium WebDriver, handling these events includes operations such as drag and drop, clicking on multiple elements with the control key, among others. These operations are performed using the advanced user interactions API. It mainly consists of Actions that are needed while performing these operations.
Select Class :In Selenium, the Select class provides the implementation of the HTML SELECT tag. A Select tag provides the helper methods with select and deselect options. As Select is an ordinary class, its object is created by the keyword New and also specifies the location of the web element.
8. How to right click in Selenium?
Right click action in Selenium web driver can be done using Actions class. Right Click operation is also called Context Click in Selenium.
9. Tell me about TestNG annotations?
TestNG Annotations are used to control the next method to be executed in the test script. TestNG annotations are defined before every method in the test code. In case any method is not prefixed with annotations, it will be ignored and not be executed as part of the test code.
10. How to execute any test case if it depends on other test case in TestNG?
Dependency is a feature in TestNG that allows a test method to depend on a single or a group of test methods. This will help in executing a set of tests to be executed before a test method.
11. What is XPath? What are different types of Xpath? Which one will you choose?
XPath is defined as XML path. XPath is used to find the location of any element on a webpage using HTML DOM structure.
There are two type of Xpath
Absolute XPath
Relative XPath
Always Relative Xpaths are preferred as they are not the complete paths from the Root element.
12. How to do Parent child traversing in XPath?
With selenium xpath parent child traverse relationship method, you identify a unique parent or grand parent and from that point carefully traverse to your desired object with the help of tags and back slashes
13. How you will give priority in TestNG
Definition of Priority in TestNG test methods can only be the @Test methods
The following is the syntax for allocating a priority to a test case method.
@Test (priority = 1) public void func(){</em></p> //test code</em></p> }
14. How to do window handling in selenium?
A window handle is a unique identifier that holds the address of all the windows. This is basically a pointer to a window, which returns the string value.
- get.windowhandle(): helps in getting the window handle of the current window.
get.windowhandles(): helps in getting the handles of all the windows opened.
15. What is the difference in between Verify and Assert?
Verify: Verify command also checks whether the given condition is true or false. Irrespective of the condition being true or false, the program execution doesn’t halt i.e. any failure during verification would not stop the execution and all the test steps would be executed.
Assert: Assert command checks whether the given condition is true or false. If the condition is true then the program control will execute the next test step but if the condition is false, the execution would stop and no further test would be executed.
16. What are java modifiers?
Java Modifier | Description |
public | The code is accessible for all classes |
private | The code is only accessible within the declared class |
default | The code is only accessible in the same package. This is used when you don’t specify a modifier. |
protected | The code is accessible in the same package and subclasses. |
17. Which java modifiers you used in your project?
I have used public modifier as its accessible across packages.