CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.




Get it now !!
Send your Resume to 6000 Companies
Selenium Interview Questions & Answers - Learning Mode
COOLINTERVIEW.COM AUTOMATED TESTING TOOLS INTERVIEW QUESTIONS SELENIUM INTERVIEW QUESTIONS QUESTIONS & ANSWERS - LEARNING MODE

Selenium Interview Questions & Answers - Learning Mode

Selenium is a free (open source) automated testing suite for web applications across different browsers and platforms. It is quite similar to HP Quick Test Pro (QTP) only that Selenium focuses on automating web-based applications. Selenium is not just a single tool but a suite of software's, each catering to different testing needs of an organization. It has four components. Selenium Integrated Development Environment (IDE) Selenium Remote Control (RC) WebDriver Selenium Grid.

Try Selenium Interview Questions & Answers - Exam Mode

1 2 3 4 Next

Sort By : Latest First | Oldest First | By Rating

Selenium Interview Questions & Answers - Learning Mode
Try Selenium Interview Questions & Answers - Exam Mode
Question: What is TestNG Soft Assertion in selenium webdriver software testing tool?

Answer: Using TestNG soft assertion, we can continue our test execution even if assertion fails. That means on failure of soft assertion, remaining part of @Test method will be executed and assertion failure will be reported at the end of @Test method. Source: CoolInterview.com
Question: List the WebDriver Supported Browsers?

Answer: Selenium WebDriver API has different drivers to test your web application in different browsers. Following is the list:
Firefox Driver - For Mozilla Firefox browser
Internet Explorer Driver - For Internet Explorer browser
Chrome Driver - For Google Chrome browser
HtmlUnit Driver - GUI-Less(Headless) browser for Java programs
Opera Driver - For Opera browser
Source: CoolInterview.com
Question: What does a comment look like in Source view?

Answer: <!--This is a comment-->
Source: CoolInterview.com
Question: Which one is better xpath or CSS ?

Answer: xpath. Source: CoolInterview.com
Question: What are benefits of using Selenium as a testing tool?

Answer: Following are list of benefits of using Selenium as a testing tool:

1. It is available free of cost.
2. Works on all the platforms i.e, Windows, LINUX, MAC OS.
3. Works on all the browsers i.e, Firefox, chrome, Internet Explorer, Safari etc.
4. We can write tests in different programming languages like Java, PHP, C#, Perl, Pyton, Ruby and Groovy.
5. Supports distributed testing
Source: CoolInterview.com
Question: Which OpenSource Framework is supported in WebDriver with Java?

Answer: JUnit and TestNG are two OpenSource Framework supported in WebDriver with Java Source: CoolInterview.com
Question: What is Selenium?

Answer: Selenium is an open source automated testing tool to test web applications released under Apache 2.0 license. Source: CoolInterview.com
Question: What methods are used to open URL in web browser in selenium webdriver software testing tool?

Answer: Following methods are used to open URL in web browser in selenium webdriver software testing tool:

1. driver.get()method is used to open URL of software web application. This method will wait till the whole page gets loaded.

2. driver.navigate()is used for navigate to URL of software web application, navigate back, navigate forward, refresh the page. It will just navigate to the page but will not wait till the whole page gets loaded. Source: CoolInterview.com
Question: What is the syntax to type value in prompt dialog box's input field using selenium WebDriver?

Answer: Prompt dialog is just like confirmation alert dialog but with option of Input text box. To input value in that text box of prompt dialog, we can use bellow given syntax.

driver.switchTo().alert().sendKeys("Jhon");
Source: CoolInterview.com
Question: Tell me different JUnit annotations and its usage.

Answer: JUnit has bellow given different annotations.

@Test : @Test annotation Is useful to Identify method as a Test method from software automation test script.
@Before : @Before annotation method will be executed before each and every @Test method.
@After : @After annotation method will be executed after each and every @Test method.
@BeforeClass : @BeforeClass annotation method will be executed before all @Test methods In a class(Means before first @Test method).
Source: CoolInterview.com
Question: Explain setSize method of selenium webdriver software testing tool?

Answer: setSize method of selenium webdriver software testing tool is used to set the size of browser window. The following command set the size of browser window to 500 x 500.

driver.manage().window().setSize(new Dimenson(500,500)); Source: CoolInterview.com
Question: How to achieve flow control in Selenium IDE?

Answer: Selenese does not support condition statements (if else, if)or iterations(for, while)as it executes the script line by line i.e in the sequence. So when flow control is needed, there are three options:

1. Run the script using Selenium-RC and a client library such as Java or PHP to utilize the programming language?s flow control features.

2. Run a small JavaScript snippet from within the script using the storeEval command.

3. Install the goto_sel_ide.js extension. Source: CoolInterview.com
Question: What is the difference between setSize() and getSize()method?

Answer: window().setSize() method is used to set the size of window in selenium webdriver software test.e.g:

driver.manage().window().setSize(new Dimension(300,500));

The above syntax is used set window width to 300 and height to 500.

window().getSize() method is used to get size of window. E.g.:
driver.manage().window().getSize().getHeight()
The above syntax will return window height.

driver.manage().window().getSize().getWidth()
The above syntax will return window Source: CoolInterview.com
Question: What is the difference between setPosition() and getPosition()?

Answer: window().setPosition() to set position of window. E.g: We can set window position to 50 points from left side and 200 points from top side using bellow given syntax.

driver.manage().window().setPosition(new Point(50,200));


window().getPosition() to get position of window
Use window().getPosition().getX() to get window position from left side as bellow.

driver.manage().window().getPosition().getX()


To get window position from top side of screen, use window() Source: CoolInterview.com
Question: What is the difference between Borland Silk and Selenium?

Answer: 1. Borland Silk test is not a free testing tool while Selenium is completely free test automation tool.

2. Silk test supports only Internet Explorer and Firefox while Selenium supports many browsers like Internet Explorer, Firefox, Safari, Opera and so on.

3. Silk test uses test scripting language while Selenium suite has the flexibility to use many languages like Java, Ruby,Perl etc.

4. Silk test can be used for client server applications while Selenium can be used for only Source: CoolInterview.com
Question: What method is used to capture screenshot in Selenium WebDriver software testing tool?

Answer: TakesScreenshot method is used to capture screenshot. Java File class will be used to store screenshot in your system's local drive. Source: CoolInterview.com
Question: What is Selenium IDE?

Answer: Selenium IDE is the simplest and easiest of all the tools within the Selenium Package. Its record and playback feature makes it exceptionally easy to learn with minimal acquaintances to any programming language. Selenium IDE is an ideal tool for a na? user. Source: CoolInterview.com
Question: What is the difference between Absolute XPath and Relative Xpath?

Answer: Absolute XPath
Absolute XPath starts with the root node or a forward slash (/).
The advantage of using absolute is, it identifies the element very fast.
Disadvantage here is, if any thing goes wrong or some other tag added in between, then this path will no longer works.

Relative Xpath
A relative xpath is one where the path starts from the node of your choise - it doesn't need to start from the root node. It starts with Double forward slash(//)
Advantage of using relati Source: CoolInterview.com
Question: What are the disadvantages of xPath locator as compared to cssSelector locator?

Answer: Following is the list of disadvantages of xPath locator as compared to cssSelector locator:

1. xPath is slower than cssSelector locator.

2. Every browser reads xPath in different way. e.g, some browsers lie IE reads only lower-cased tag name and attribute Name. So if used in upper case then it will work in Firefox browser but will not work in IE browser.
So we cannot use XPath locators for cross browser testing using selenium WebDriver software testing tool. Source: CoolInterview.com
Question: List webdriver common exceptions which you faced during software test case execution?

Answer: TimeoutException - This exception will be thrown when command execution does not complete in given time.

NoSuchElementException - WebDriver software testing tool will throw this exception when element could not be found on page of software web application.

NoAlertPresentException - This exception will be generated when webdriver tries to switch to alert popup but there is not any alert present on page.

ElementNotSelectableException - It will be thrown when webdriver is tryin Source: CoolInterview.com

1 2 3 4 Next



India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0.046021 Seconds