Are you preparing for a Selenium interview? If so, you’ll want to be sure to brush up on your Selenium interview questions.
In this blog post, we’ll provide you with a list of Selenium interview questions that are likely to come up in an interview setting. We’ll also provide tips on how to answer these questions.
2) What is Selenium 0?
Web Testing tools Selenium RC and WebDriver are consolidated in single tool in Selenium 2.0
1 Why do testers choose Selenium over QTP?
Selenium is more widely used than QTP since:
You can find more on Selenium by visiting our Selenium Community!
2 How to send ALT/SHIFT/CONTROL key in Selenium WebDriver?
When we generally use ALT/SHIFT/CONTROL keys, we hold onto those keys and click other buttons to achieve the special functionality. So it is not enough just to specify keys.ALT or keys.SHIFT or keys.CONTROL functions.
For the purpose of holding onto these keys while subsequent keys are pressed, we need to define two more methods: keyDown(modifier_key) and keyUp(modifier_key)
Parameters: Modifier_key (keys.ALT or Keys.SHIFT or Keys.CONTROL) Purpose: Performs a modifier key press and does not release the modifier key. Subsequent interactions may assume it’s kept pressed.
Parameters: Modifier_key (keys.ALT or Keys.SHIFT or Keys.CONTROL) Purpose: Performs a key release. Hence with a combination of these two methods, we can capture the special function of a particular key.
1 How can you launch a browser using Selenium WebDriver?
The following syntax is used to launch a browser using Selenium WebDriver:
TestNG Interview Questions:
Here we have dealt with some important TestNG interview questions. If you want to learn more interview questions related to TestNG then here you go. We have a special post on TestNG Interview Questions. Also, you could find TestNG Complete Tutorial here
13 Where you have applied OOPS in Automation Framework?
Here we have given a clear explanation of the application of OOPs in Automation Framework
12 What is Parameterized testing in TestNG?
Parameterized tests allow developers to run the same test over and over again using different values.
There are two ways to set these parameters:
3 How to skip a method or a code block in TestNG?
If you want to skip a particular test method, then you can set the ‘enabled’ parameter in test annotation to false. @Test(enabled = false)
By default, the value of ‘enabled’ parameter will be true. Hence it is not necessary to define the annotation as true while defining it.
17) What is the difference between setSpeed() and sleep() methods?
Both will delay the speed of execution.
It will stop the current (java) thread for the specified period of time. Its done only once
Ex: thread.sleep(2000)- It will wait for 2 seconds
For specific amount of time it will stop the execution for every selenium command.
Ex: selenium.setSpeed(“2000”)- It will wait for 2 seconds
This command is useful for demonstration purpose or if you are using a slow web application