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 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: 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: What is echo command in Selenium IDE?

Answer: Echo command is used to print content of Selenium variables. It is used for debugging test case. When "echo" command is executed, it will display current stored value of variable into Log area of selenium IDE software testing tool's window. 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: 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: 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 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 command simulates selecting the browser's Back button in Selenium IDE?

Answer: goBack command
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 are different assertions supported by JUnit?

Answer: List of JUnit assertions as bellow.

assertEquals
assertFalse
assertTrue
assertNull
assertNotNull
assertSame
assertNotSame
assertArrayEquals
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: Which one is better xpath or CSS ?

Answer: xpath. Source: CoolInterview.com
Question: What Is TestNG? Explain its functionalities that makes it powerful than other framework.

Answer: TestNG ("Testing, the Next Generation") is an open source Java unit testing framework that aims to overcome many limitations of JUnit and NUnit. Some new functionalities that make it more powerful and easier to use, such as:
1. JDK 5 Annotations: Annotations in TestNG are lines of code that can control how the method below them will be executed.

2. Flexible test configuration

3. Support for data-driven testing (with @DataProvider)

4. Support for parameters

5. Al Source: CoolInterview.com
Question: What is the usage of setting priority of @Test method?

Answer: In test case we can set priority for TestNG @Test annotated methods as bellow.

@Test(priority=0)

By using priority we can control @Test method execution manner as per our requirement. That means @Test method with priority = 0 will be executed 1st and @Test method with priority = 1 will be executed 2nd and so on.
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: What is Selenium 2?

Answer: Web testing tools Selenium RC and WebDriver are merged in single tool in Selenium 2.0 Source: CoolInterview.com
Question: What is the difference between verify and assert commands?

Answer: Assert: Assert allows to check whether an element is on the page or not. The test will stop on the step failed, if the asserted element is not available. In other words, the test will terminated at the point where check fails.

Verify: Verify command will check whether the element is on the page, if it is not then the test will carry on executing. In verification, all the commands are going to run guaranteed even if any of test fails. Source: CoolInterview.com
Question: What are the steps to build test case in Selenium IDE?

Answer: To build test cases we will need following 3 steps:

1. Recording: Whenever we open Selenium IDE by default Record button is on. If you don't want to start recording automatically you need to go to options and deselect ?Start recording immediately on open.? Based on user actions on browser the tool will record the actions and insert commands in the test case. The common commands are click, clickAndWait, type, select commands.

2. Adding Verifications and Asserts With the Context 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

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.09375 Seconds