Selenium Interview Question and answer.

Q. How to handle parent-child web locator of web page.
Q. How to verify data of dynamic web table.
Ans. There are two types of HTML tables published on the web.
Static: Data is static i.e. Number of rows and columns are fixed
1. Find table say T
2. Find row say R using T.row[n]
3. Then find column say C of that row like R.col[n]
4. C.getText()

Dynamic:Data is dynamic i.e. Number of rows and columns are NOT fixed.
Q. How to handle java script Alert and popup.
Q. What is exception and explain some most common used exceptions.
Q. What is difference between elementNotFound and elementNotVisisble exception.
Q. How to call external executable file in your selenium script.
Q. How to handle windows dialog using selenium webdriver.
Q. What is implicit and explicit wait in selenium.
Q. How to handle multiple browser’s windows in selenium.
Q. How to handle frames in selenium.
Q. How to get and set text in Textarea element.
Q. How to handle(select/deselect) drop down list using selenium.
Q. How to handle multi select drop down list.
Q. Difference between driver.quit() and driver.close().
Q. Describe about ngWebDriver.
Ans. ngWebDriver – This is a way to automate angular based apps in selenium using java.
As we know we can use selenium webdriver and java to test angular js controls, but there are few limitations we need to stick to one locator strategy as selenium itself do not have locators method specific to handle angular controls like ngbinding, ngrepeater etc…), and sometime angular element’s actions lag behind the selenium line by line execution.
To overcome above issues angular js controls with selenium and java, a library known as ngWebDriver came out to add features to selenium and can write the scripts in java
ngwebdriver basically taken the advantage of other language like protractor and passing the javascript to browser to handle angular controls and also allows to write scripts in java language without any synchronization issue.

Let’s list our few angular controls that are different than normal html elements

If you observe, we can not use these controls value directly using selenium webdriver and java like id, tagname, link etc..

but ngwebdriver has capability to identify the above elements directly, let’s see
byAngular.repeater(str) – Angular web table

For setup simply add ngwebdriver-x.x.jar file to your existing selenium project and write below code.
You can download jar file from

public class NGDriverTest {
private static NgWebDriver ngDriver;
public static void main(String[] args) {
System.setProperty("", "d:\\test\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
ngDriver = new NgWebDriver((JavascriptExecutor) driver);

Q. What type all type of options are available headers parts of http requests.

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: