Pages

Monday, 14 August 2017

100 TOP Interview Questions on Selenuim IDE


1) What is Automation Testing?
Automation testing is a process in which software tools execute pre-scripted tests on a software application before it is released into production. Special software is used to control the test execution, actual outcomes and predicted outcomes comparison, the test preconditions setting up, and other test control and test reporting functions.

2) What are the main advantages of Automation Testing?
Regression testing coverage, test engineer productivity, consistency in testing, test cases reusability, reduced software maintenance cost, increased test effectiveness, reduction of the test interval, reducing human-generated errors.

3) So, what is Selenium?
Selenium is a robust test automation suite designed in a way to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms.
Best Selenium Interview Questions

4) What are the main advantages of Selenium?
Selenium is a free and open source. You don't need to spend any licensing cost to use it.
Cross Browser compatibility (Firefox, Chrome, Internet Explorer, Safari etc.)
Multiple programming languages (Java, C#, Ruby, Python, Pearl etc.) support
Compatibility with the main platform (Windows, Mac OS, Linux etc.)
Huge amount user base and helping communities
Automation scripts creating ability for non-programmers as well as for programmers
Testing distribution support
Regular and fresh repository developments

5) What Selenium components do you know?
Selenium is a suite of tools for automated web testing.  It is composed of:
Selenium IDE (Integrated Development Environment). It is a tool for recording and playing back. It is a Firefox plugin.
WebDriver and RC. It provides the APIs for a variety of languages like Java, .NET, PHP, etc. They work with most of the browsers.
Grid: you can distribute tests on multiple machines so that test can be run parallel which helps cutting down the time required for running test suites in the browser.

6) How many types of Webdriver APIs are available in Selenium?
The list of driver classes could be used for the browser automation.
AndroidDriver,
ChromeDriver,
EventFiringWebDriver,
FirefoxDriver,
HtmlUnitDriver,
InternetExplorerDriver,
iPhoneDriver,
iPhoneSimulatorDriver,
RemoteWebDriver

7) Does the Selenium have any limitations?
Selenium supports only web based applications testing. So, here are the limitations of it:
Mobile applications cannot be tested using Selenium
Desktop applications cannot be tested using Selenium
Captcha and Bar code readers cannot be tested using Selenium
User should use third-party tools like TestNG or jUnit to write test scripts and generate reports
Programming language knowledge is required to create robust scripts in Selenium WebDriver

8) What is Selenium IDE?
Selenium IDE is a plug-in used to record and replay tests in Firefox browser. Scripts may be automatically recorded and edited manually providing auto-completion support and the ability to move commands around quickly.

9) What is Selenese?
Selenese is the language which is used to write test scripts in Selenium IDE.

10) What kinds of test types are supported by Selenium?
Functional Testing
Regression Testing
Sanity Testing
Smoke Testing
Responsive Testing
Cross Browser Testing
UI testing (black box)
Integration Testing
are supported by Selenium.

11) What are the different types of locators in Selenium?
The different types of locators in Selenium are ID, ClassName, Name, TagName, LinkText, PartialLinkText, XPath, CSS Selector, DOM.

12) What automation tools could be used for post-release validation with continuous integration?
Automation tools could be used for post-release validation with continuous integration: CruiseCont, Hudson, Jenkins, Quick Build.

13) Explain the meaning of assertion in Selenium and what are the types of assertion?
Assertion is used as a verification point. It verifies that the application state conforms to the expectation.  The types of assertion are “assert”, “verify” and “waifFor”.

14) Explain the difference between assert and verify commands?
Both of them check if the given condition is true or false. Unlike to "assert", "verify" will not stop the test case execution if the test case fail.

15) What is a XPath?
XPath is a language that describes a way to locate and process items in Extensible Markup Language (XML) documents by using an addressing syntax based on a path through the document's logical structure or hierarchy.

16) What is an Absolute XPath?
Absolute XPath is the direct way to find the element. It has a disadvantage. XPath gets failed if there are any changes made in the path of the element.  html/body/div[3]/div/div[1]/div/div/div[1]/div/input - Absolute XPath example.

17) What is a Relative XPath?
Relative XPath means that user can start from the middle of the HTML DOM structure and no need to write long XPath. Example of Relative XPath - //input[@id='email'].

18) What is the difference between single slash (/) and a double slash ( //) in XPath?
A single slash (/) is used for creating XPaths with absolute paths beginning from the root node.
Double slash (//) is used for creating relative XPath to start selection from anywhere within the root node

19) How could the web element attributes be inspected in order to use them in different locators?
Firebug is a Firefox plugin that provides various development tools for debugging applications. From an automation perspective, Firebug is used specifically for inspecting web-elements in order to use their attributes like id, class, name etc. in different locators.

20) Give an example of the languages supported by WebDriver.
Java, C#, Python, and Ruby, are all supported directly by the development team. There are also PHP and Perl WebDriver implementations.

21) How can we launch different browsers in Selenium WebDriver?
We should create an instance of a driver of a particular browser:
WebDriver driver = new FirefoxDriver();

22) What the WebDriver supported Mobile Testing Drivers do you know?
Mobile Testing Drivers supported by the WebDriver are: AndroidDriver, IphoneDriver, OperaMobileDriver.

23) Explain the fundamental difference between XPath and CSS selector.
Using CSS selector we can only move downwards in the document, using XPaths we traverse up in the document.

24) How can you find if an element is displayed on the screen?
There are different methods, which help user to check the visibility of the web elements: isDisplayed(), isEnabled(), isSelected(). These web elements can be buttons, drop boxes, checkboxes, radio buttons, labels etc.

25) What is the difference between "type" and "typeAndWait" command?
If you need to type keyboard key values into a text field of the web application, "type" command will be used. Another reason for its usage is selecting values of the combo box. "typeAndWait" command is used when your typing is completed and software web page start reloading.

26) How can the user get a text of a web element?
User can retrieve the text of the specified web element by using get command. It doesn’t require any parameter but returns a string value.
String Text = driver.findElement(By.id(“Some Text”)).getText()
is an example of it.

27) How a text written in a text field could be cleared?
A text written in a text field could be deleted by using the clear() method.

28) How to check a checkBox in Selenium?
The same click() method could be used for checking checkbox as well as for clicking buttons or radio buttons.

29) How to verify if the checkbox/radio is checked or not?
isSelected() method is used to verify if the checkbox/radio is checked or not.
An example -
driver.findElement(By.xpath("XPath of the checkbox/radio button")).isSelected();

30) What is the alternate way to click on login button?
submit() method could be used as the alternate way to click on login button, but only if attribute type=submit.

31) How to select a value in a dropdown?
WebDriver’s Select class is used to select value in the drop down.
selectByVisibleText:
Select selectByVisibleText = new Select (driver.findElement(By.id(“id_of_some_element”)));
selectByVisibleText.selectByVisibleText(“some_visible_text”);

32) Explain the difference between close and quit command.
If you need to close the current browser having focus driver.close() is used. If you need to close all the browser instances driver.quit() is used.

33) What is the difference between setSpeed() and sleep() methods?
Both of these methods delay the speed of execution. The main difference between them is setSpeed sets a speed while will apply delay time before every Selenium operation takes place. thread.sleep() will set up wait only for once.

For Example:
sleep(5000)- It will wait for 5 seconds. It is executed only once, where the command is written.
setSpeed("5000")- It also will wait for 5 seconds. It runs each command after setSpeed delay by the number of milliseconds mentioned in set Speed.

34) What are the different types of navigation commands?
navigate().back() command takes user back to the previous webpage in the web browser’s history. An example: driver.navigate().back();
navigate().forward() lets the user to navigate to the next web page with reference to the browser’s history. An example: driver.navigate().forward();
According to navigate().refresh() command user can refresh the current web page there by reloading all the web elements. An example: driver.navigate().refresh();
User can launch a new web browser window and navigate to the specified URL by executing navigate().to() An example:
driver.navigate().to(“https:// thinkmobiles.com/”);

35) What is the difference between findElement () and findElements ()?
Both of them let user to find elements in the current web page matching to the specified locator value. But if you use findElement(), only the first matching element would be fetched. An example:
WebElement element = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”))
If you use findElements(), the all matching elements would be fetched and stored in the WebElements list. An example:
List elementList = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));

36) Can Selenium handle Windows based pop-up?
Windows pop-ups cannot be handled by using Selenium. Because it supports only web application testing.

37) How can we handle Web-based pop-up?
There are four methods of the effective Web-based pop-up handling:
string getText() method returns the text displayed on the alert box
void accept() method clicks on the “Ok” button as soon as the pop-up window appears
void dismiss() method clicks on the “Cancel” button as soon as the pop-up window appears
void sendKeys(String stringToSend) method enters the specified string pattern into the alert box

38) Do you know a way to refresh browser by using Selenium?
The list of commands to refresh a page in Selenium:
navigate().refresh()
getCurrentUrl()
navigate().to(driver.getCurrentUrl())
sendKeys(Keys.F5)

39) How can we maximize browser window in Selenium?
driver.manage().window().maximize(); //command is used to maximize browser window in Selenium

40) How can we find the value of different attributes like name, class, value of an element?
getAttribute("{attributeName}") //method is used find the value of different attributes of an element

41) Could cookies be deleted in Selenium?
driver.manage().deleteAllCookies(); //command is used for deleting all cookies

42) How to perform right click using Selenium WebDriver?
The next Actions class is used to perform right click:
Actions act = new Actions(driver); // where driver is WebDriver type
act.moveToElement(webElement).perform();
act.contextClick().perform();

43)  How do perform drag and drop using Selenium WebDriver?
The next Actions class is used to perform drag and drop:
Actions builder = new Actions(driver);
Action dragAndDrop = builder.clickAndHold(SourceElement)
moveToElement(TargetElement)
release(TargetElement)
build();
dragAndDrop.perform();

44) How to check if an element is visible on the page?
The return method type is logical. If it returns true then element is visible otherwise it is not. isDisplayed() method could be used for it:
driver.findElement(By.id(“id_of_element”)).isDisplayed();

45) How to check if a button is enabled on the page?
isEnabled() method could be used for it:
driver.findElement(By.id(“id_of_element”)).isEnabled();

46) What kind of mouse actions can be performed in Selenium?
Selenium supports different mouse actions, such as:
click(WebElement element)
contextClick(WebElement element)
doubleClick(WebElement element)
mouseUp(WebElement element)
mouseDown(WebElement element)
mouseMove(WebElement element)
mouseMove(WebElement element, long xOffset, long yOffset)

47) Can you write the code to double click an element in Selenium?
Code to double click an element in Selenium:
Actions action = new Actions(driver);
WebElement element=driver.findElement(By.id("elementId"));
action.doubleClick(element).perform();

48) How to mouse hover an element in Selenium?
Code to mouse hover over an element in Selenium:
Actions action = new Actions(driver);
WebElement element=driver.findElement(By.id("elementId"));
action.moveToElement(element).perform();

49) What kind of keyboard operations can be performed in Selenium?
Selenium lets to perform different kinds of keyboard operations, such as:
.pressKey("non-text keys") is used for keys like control, function keys etc that are non-text
.releaseKey("non-text keys") is used in conjunction with key press event to simulate releasing a key from keyboard event
.sendKeys("sequence of characters") is used for passing character sequence to an input or textbox element.

50) What is JUnit? And what is JUnit Annotation?
JUnit is an open source Java applications testing framework, introduced by Apache. A process of adding a special form of syntactic metadata to Java source code is called annotation. JUnit Annotations are: variables, parameters, packages, methods and classes.

51) What is TestNG and why is it better than JUnit?
TestNG is a testing framework inspired from JUnit and NUnit in a way to use the merits by both the developers and testers.  Here are some new functionalities that make it more powerful and easier to use, such as:
test that your code is multithread safe
support for data-driven testing
support for parameters
a variety of tools and plug-ins support (Eclipse, IDEA, Maven, etc...)
default JDK functions for runtime and logging
dependent methods for application server testing
flexible test configuration

52) What kinds of annotations are used in TestNG?
The following kinds of annotations are used in TestNG:
Test
BeforeSuite
AfterSuite
BeforeTest
AfterTest
BeforeClass
AfterClass
BeforeMethod
AfterMethod

53) How to set test case priority in TestNG?
TestNG "Priority" is used to schedule the test cases. In order to achieve, we need to add an annotation as @Test(priority=??). The default value will be zero for priority. If you don't mention the priority, it will take all the test cases as "priority=0" and execute.
The example below shows the usage of the priority for test cases.
As we have not defined the priority for test case "Registration", it will get executed first and then the other test cases based on priority.

import org.testng.annotations.Test;
public class testNGPriorityExample {
@Test
public void registerAccount()
{
System.out.println("Create an account");
}
@Test(priority=2)
public void sendEmail()
{
System.out.println("Confirm your email");
}
@Test(priority=1)
public void login ()
{
System.out.println("Execute login after confirmation");
}
}

import org.testng.annotations.Test;
public class testNGPriorityExample {
@Test
public void registerAccount() {
System.out.println("Create an account");
}
@Test(priority=2)
public void sendEmail() {
System.out.println("Confirm your account");
}
@Test(priority=1)
public void login() {
System.out.println("Execute login after confirmation");
}
}

54) Explain how you can find broken images in a page using Selenium Web driver?
You have to follow the next steps to find broken images in a page using Selenium Web driver:
get XPath and get the all links on the page using the tag name
click on  every link on the page
look for 404/500 in the target page title

55) Can captcha and bar code reader be automated by using Selenium?
Neither captcha, no bar code reader can be automated by using Selenium.

56) How to verify tooltip text using Selenium?
The tooltip text in Selenium could be verified by fetching the value of 'title' attribute. An example:

String toolTipText = element.getAttribute("title");

57) How to locate a link using its text in Selenium?
linkText() and partialLinkText() are used for link location.

The examples:
WebElement link1 = driver.findElement(By.linkText(“some_link_test”));
WebElement link2 = driver.findElement(By.partialLinkText(“some_link_part_text”));

58) Can we find all links on a web page?
As all  links are of anchor tag 'a', so we can find all of them on a web page by locating elements of tagName ‘a’:
List links = driver.findElements(By.tagName("a"));

59) How can we capture screenshots in Selenium?
We can take the screenshots in selenium by using getScreenshotAs method of TakesScreenshot interface:
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.File(scrFile, new File("C:\\screenshot1.jpg"));

60) Explain how colors could be handled in Selenium WebDriver?
To handle colors could be handled in Selenium WebDriver by using Use getCssValue(arg0) function to get the colors by sending ‘color’ string as an argument.

61) How many exceptions do you know in Selenium WebDriver?
There are 5 different exceptions Selenium WebDriver:
NoAlertPresentException,
NoSuchElementException
NoSuchWindowException
TimeoutException
WebDriverException

62) How will you use Selenium to upload a file?
File uploading action could be performed by using element.sendKeys("path of file") on the webElement of input tag and type file: < name="fileUpload" type="file" />

63) What is Robot API?
Robot API is used to control keyboard or mouse to interact with OS windows like Download pop-up, Alerts, Print Pop-ups, etc. or native Operation System applications like Notepad, Skype, Calculator, etc.

64) What methods of Robot Class do you know?
Some commonly and popularly used methods of Robot Class during web automation:
keyPress(): method with press down arrow key of Keyboard
Example:
keyPress(KeyEvent.VK_DOWN)
keyRelease(): method with release down arrow key of Keyboard:
Example:
robot.keyRelease(KeyEvent.VK_DOWN)
mouseRelease() method will release the right click of your mouse
Example:
mouseRelease(InputEvent.BUTTON3_DOWN_MASK)
mouseMove() method will move mouse pointer to the specified X and Y coordinates.
Example:
robot.mouseMove(point.getX(), point.getY())
mousePress() method will press the right click of your mouse.
Example :
robot.mousePress(InputEvent.BUTTON3_DOWN_MASK)
 
65) How to execute JavaScript in Selenium?
JavaScriptExecuter is used for JavaScript execution in Selenium.

A simple example:
WebDriver driver = new FireFoxDriver();
if (driver instanceof JavascriptExecutor) {
((JavascriptExecutor)driver).executeScript("{JavaScript Code}");
}

66) Which package can be imported while working with WebDriver?
org.openqa.selenium java -cp bin;jars/* org.testng.TestNG testng.xml

67) How do you get the width of the textbox?
You can get the width of the textbox by using the following command:
driver.findElement(By.xpath(“xpath of textbox ”)).getSize().getWidth();
driver.findElement(By.xpath(“xpath of textbox ”)).getSize().getHeight()

68) Which web driver implementation is the fastest?
The fastest WebDriver is HtmlUnitDriver. Differing of other drivers (FireFoxDriver, ChromeDriver etc), it’s non-GUI, while running no browser gets launched.

69) What is the purpose of deSelectAll() method?
It is used to deselect all the options which have been selected from the drop-down list.

70) How can you switch back from a frame?
defaultContent() method is used to switch back from a frame.

71) How to login into any site if it’s showing any authentication pop-up for username and password?
You should pass the username and password with URL:
https://username:password@url
https://creds:test@www.test.com

72) What is the purpose of getOptions() method?
getOptions() is used to get the selected option from the drop-down list.

73) What is the difference between getWindowHandles() and getWindowHandle()?
You can get the browser address using these commands. But if you use getWindowHandle(), you’ll get the address of the current browser where the control is and return type is a string. So, if you use getWindowHandles(), you will get the address of all the open browser and its return type is an iterator.

74) Explain how you can use recovery scenario with Selenium?
You can use recovery scenario in accordance with the programming language.
If it is Java then you can use exception handling to overcome same.

75) How do you send ENTER/TAB keys in WebDriver?
use click() or submit() methods are used for ENTER. But, don’t forget that submit() method is used only if type=’submit’.
You can use Actions class act.sendKeys(Keys.ENTER) for TAB.

76) How to Handle Alerts in Selenium WebDriver?
Here are a few methods of Alerts handling which are widely used in Selenium Webdriver.
void dismiss() is used to click on the 'Cancel' button of the alert.
driver.switchTo().alert().dismiss();
void accept() is used to click on the 'OK' button of the alert.
driver.switchTo().alert().accept();
String getText() is used to capture the alert message.
driver.switchTo().alert().getText();
void sendKeys(String stringToSend) is used to send some data to alert box.
driver.switchTo().alert().sendKeys("Text");

77) What is a data-driven framework?
The Data Driven test design framework follows a design paradigm where test logic is fixed but varies the test data.  The data itself can be in different repositories like a simple .csv file, .json file or .xls sheet, or database and can add the tests merely updating those external files or DB (instead of placing in test code itself).

78) What is a keyword-driven framework?
The keyword driven framework is a methodology where actions or steps are treated as keywords. These keywords (like click, move, type etc.,) are stored in some external repositories along just like data (in .csv/.json/.xls/DB).

79) What is the hybrid framework?
The combination of data driven and keyword driven framework is called the hybrid. Here the operations/instructions/keywords in a separate repository (.csv/.xls/.json/DB) and data is in separate (.csv/.xls/.json/db from data provider) and the tests/driver would read both and perform the actual tests automatically. In this design, we get the best of both methodologies, and it is kind of practical in most of the automation cases.

80) What are the main advantages of Selenium Grid?
Selenium Grid has following advantages: multi-browser testing, parallel test case execution, multi-platform testing.

81) What is a hub in Selenium Grid?
Selenium Grid hub is a central point or a server that controls the test executions on the different machines.

82) What is a node in Selenium Grid?
Selenium Grid node is a hub attached machine, which has instances running the test scripts. Unlike a hub, there can be more than one nodes in Selenium Grid.

83) Could you explain the line of code Webdriver driver = new FirefoxDriver();.
‘WebDriver' is an interface and we are creating an object of type WebDriver instantiating an object of FirefoxDriver class.

84) What is the purpose of creating a reference variable- 'driver' of type WebDriver instead of directly creating a FireFoxDriver object or any other driver's reference in the statement Webdriver driver = new FirefoxDriver();?
We can use the same variable to work with multiple browsers like ChromeDriver, IEDriver by creating a reference variable of type WebDriver.

85) How can you create HTML test report from your test script?
There are three ways of HTML test report creation:
using inbuilt default.html to get the HTML report in TestNG
with the ANT help in JUnit
using XSL jar for converting XML content to HTML in own customized reports

86) What could be the cause of Selenium WebDriver test to fail?
There are some causes of Selenium WebDriver test to fail:
SeleniumWebDriver element waiting to access did not appear on the web page and the operation timed out
SeleniumWebDriver is trying to access not created element
SeleniumWebDriver cannot locate the element, because the locator has been changed

87) Explain how can you debug the tests in Selenium IDE?
The tests could be debugged in such way:
insert a break point from the location from where you want to execute test step by step
run the test case
test case execution will be paused at the given break point
click on the blue button to continue with the next statement
to continue executing all the commands at a time click on the “Run” button

88) What is the testng.xml file used for?
testng.xml file is used to configure the whole a test suite. Here we can create a test suite, create test groups, mark tests for parallel execution, add listeners and pass parameters to test scripts. It can be used for the further test suite triggering.

89) What is the difference between @Factory and @DataProvider annotation?
@DataProvider is concerned to individual test methods and run the specific methods for many times. @Factory method creates test class instances and runs all the test methods in that class with different data. sets.

90) In which format does source view show the script in Selenium IDE?
The script is shown by Selenium IDE source view in XML format.

91) How could AJAX controls be handled in WebDriver?
AJAX allows the Web page to retrieve small amounts of data from the server without reloading the entire page.
The different wait methods should be applied for testing Ajax application:
ThreadSleep
Implicit Wait
Explicit Wait
WebdriverWait
Fluent Wait

92) What is the FirefoxDriver, class or an interface? And which interface does it implement?
FirefoxDriver is a Java class.  It implements all the methods available in the interface.

93) How can we make one test method dependent on other using TestNG?
We can make one test method run only after successful execution of dependent test method by using dependsOnMethods parameter inside @Test annotation in TestNG: @Test(dependsOnMethods = { "preTests" })

94) How could you explain the main difference between WebDriver and RC?
Selenium WebDriver drives the browser using built-in support. RC injects JavaScript function into browsers when the page is loaded.

95) What is IntelliJ?
IntelliJ is an IDE that helps users to write code for Selenium better and faster. It could be used as an option to Java bean and Eclipse.

96) What are the advantages of Using Git Hub For Selenium?
Members of multiple people team working on the same project can update its details and inform other team members simultaneously
You can build the project from the remote repository regularly by using Jenkins. This helps you to keep track of failed builds.

97) Can we use Selenium RC for tests driving on two different browsers on one operating system without Selenium Grid?
We can do it if JAVA testing framework is not used. If we use Java client driver of Selenium, instead of using Java testing framework, TestNG allows us not to use Selenium Grid.

98) How can we run test cases in parallel using TestNG?
You should just to add these two key value pairs in the suite to run the tests in parallel:
parallel="{methods/tests/classes}"
thread-count="{number of threads you want to run simultaneously}".

99) How would you test your own element locator?
“Find Button” of Selenium IDE is used to test the locator. Clicking on this button, you will see on screen if your element locator is right or wrong.
Also, you can use “FirePath” plugin in FireFox

100) When AutoIT is used?
AutoIT is used to handle window GUI and non-HTML popups in the application.

[HIRING] 100 TOP Selenium IDE Multiple choice Questions and Answers pdf


Real Time Selenium IDE Online Quiz Questions and Answers




=> Also Read Selenium Interview Questions
1. The test language usually used in Selenium is __________.
A. PHP
B. Python
C. JavaScript
D. None of the above
Ans: C

2. The term AJAX expands to ________.
A. Asynchronous Java and XML
B. Asynchronous JavaScript and XML
C. Accumulated Java and XML
D. None of the above
Ans: B

3. The term JSON refers to ______________.
A. JavaScript Object Notation
B. Java Object Notation
C. Java Object Naming
D. None of the above
Ans: A
Selenium IDE Objective type Questions

4. Selenium tests _____________.
A. DOS applications
B. Browser-based applications
C. GUI applications
D. None of the above
Ans: B

5. Selenium variables are stored in _____________.
A. storedVars
B. storedVariables
C. VariablesStore
D. None of the above
Ans: A

6. Which selenium command check whether specific text exists somewhere on the page ?
A. verifyTextPresent
B. verifyTextPresent
C. CheckTextPresent
D. VerifyPresentText
Ans: A

7. What does the term CSS refers to ?
A. Cascade Style Sheets
B. Cascading Style Sheets
C. Clear Style Sheets
D. Catering Style Sheets
Ans: B

8. What is Selenium IDE ?
A. Windows Software
B. Firefox Plug-in
C. Java Software
D. Flash Plug-in
Ans: B

9. What is called that scale for large test suites or test suites that must be run in multiple environments?
A. Selenium-Grid
B. Selenium RC
C. Selenium Web driver
D. Selenium NG
Ans: A

10. Where is XPath used in ?
A. XML documents
B. MS-Word documents
C. MS-Excel documents
D. MS-PowerPoint documents
Ans: A

11. What does the term DOM refers to ?
A. Dynamic Object Model
B. Document Object Model
C. Data Object Model
D. Document Flow Object Model
Ans: B

12. What does the term regex expands to ?
A. Registered Expression
B. Regular Expression
C. Regression Expression
D. Regional Expression
Ans: B

13. Which label is used as prefix pattern to specify a globbing pattern parameter for a Selenese command ?
A. pattern
B. glob
C. regex
D. None
Ans: B

14. What is a test suite made of ?
A. Test packs
B. Tests
C. Test blocks
D. Test pattern
Ans: B

15. What does the assertTitle checks ?
A. Element title
B. Page title
C. Block title
D. Title of element under focus
Ans: B

16. Select the component which is NOT part of Selenium suite.
A. Selenium IDE
B. Selenium RC
C. SeleniumGrid
D. Selenium Web
Ans: D

17. Select the language which is NOT supported by the Selenium RC.
A. ASP
B. Java
C. C#
D. PHP
Ans: A

18. Select the name which is NOT the type of the locaters.
A. ID
B. Name
C. Password
D. Link Text
Ans: A,C

19. Is Web Driver a component of the Selenium?
A. No
B. Yes
Ans: B

20. Selenium IDE stands for
A. Selenium Intialization Development Environment
B. Selenium Interrelated Development Environment
C. Selenium Integrated Development Environment
D. Selenium Information Development Environment
Ans: C

21. Select the Browser which is supported by Selenium IDE
A. Google chrome
B. Opera mini
C. Mozilla Firefox
D. Internet Explorer
Ans: C

22. Select the operating system which is NOT supported by Selenium IDE.
A. Unix
B. Linux
C. Windows
D. Solaris
Ans: A

23. The Web driver is used
A. To execute tests on the HtmlUnit browser.
B. To design a test using Selenese
C. To quickly create tests
D. To test a web application against Firefox only.
Ans: A

24. The Selenium IDE is used
A. To create customized test results.
B. To deploy your tests across multiple environments using Selenium Grid
C. To test with HTMLUnit
D. To test a web application against Firefox only.
Ans: D

25. The Selenium RC is used
A. To run your test against different browsers (except HtmlUnit) on different operating systems.
B. To create tests with little or no prior knowledge in programming.
C. To test a web application against Firefox only.
D. To run a huge test suite, that can be executed on multiple machines.
Ans: A

26. Out of the following which can only test web applications
A. QTP
B. Selenium
Ans: B

27. Select the command which is NOT a type of assertion in Selenium IDE.
A. Assert
B. Verify
C. WaitFor
D. Wait
Ans: D

28. Select the method which selects the option at the given index.
A. selectByIndex()
B. selectIndex()
C. selectedByIndex()
D. selectByIndexes()
Ans: A

29. The Selenium can
A. access controls within the desktop
B. both web and desktop applications
C. only test web applications
Ans: C

30. The Selenium
A. Provides professional customer support
B. Test Reports are generated automatically
C. Comes with a built-in object repository
D. Cannot access elements outside of the web application under test
Ans: D

31. Can Google chrome be supported by Selenium IDE?
A. Yes
B. No
Ans: B

32. Can Unix operating system be supported by Selenium IDE?
A. No
B. Yes
Ans: A

33. Which command can be used to enter values onto text boxes?
A. sendsKeys()
B. sendKey()
C. sendKeys
D. sendKeys()
Ans: D

34. Select the language which is supported by The Selenium Web Driver
A. Perl
B. Sql
C. ASP
D. Cobol
Ans: A

35. Which Selenium component supports All Operating System?
A. Selenium Generator
B. Selenium IDE
C. Selenium WebDriver
Ans: C

36. Select the command in Selenium IDE used to open a page using the URL.
A. OpenRecord
B. Open
C. OpenText
D. OpenTable
Ans: B

37. In case of Selenium IDE, the Source view shows your script in
A. DHTML format
B. J2EE format
C. XML format
D. HTML format.
Ans: C

38. The Actions commands
A. are commands that directly interact with page elements.
B. are commands that allow you to store values to a variable.
C. are commands that verify if a certain condition is met.
Ans: A

39. Select the command which is used to check the presence of a certain element.
A. verifyTable
B. verifyTitlePresent
C. verifyTextPresent
D. verifyElementPresent
Ans: D

40. Select the command which is used to print a string value or a variable in Selenium IDE.
A. The ‘display’ command
B. The ‘echo’ command
C. The ‘print’ command
D. The ‘printr’ command
Ans: B

41. Which component of Selenium can create customized test results.
A. Web driver
B. Selenium RC
C. Selenium IDE
D. Selenium Grid
Ans: A

42. Select the command which is used to compare the contents of a table with expected values.
A. verifyTables
B. verifyTableData
C. verifyTable
D. verifyTableCell
Ans: C

43. Select the command which is used to pause execution until the specified element becomes present.
A. waitForElementPresent
B. waitForPagePresent
C. waitForTablePresent
D. waitForFieldPresent
Ans: A

44. Select the command that will NOT wait for a new page to load before moving onto the next command.
A. clickAndWait
B. selectAndType
C. typeAndWait
D. selectAndWait
Ans: B

45. Select the command which is used to pause execution until the page is loaded completely.
A. waitForPageToLoad
B. waitForElementPresent
C. waitForPage
D. waitForLoad
Ans: A

46. Select the syntax to locate an element using inner text.
A. css=tag:contains(“inner text”)
B. css=tag:value(“inner text”)
C. css=tag:attributes(“inner text”)
D. css=tag:class(“inner text”)
Ans: A

47. Select the command which is used to compare the actual page title with an expected value.
A. verifyTitle
B. verifiedTitle
C. verifyTitles
D. verifiedTitles
Ans: A

48. Select the command which is NOT used in verifying page elements .
A. verifyElementPresent
B. verifyElementRight
C. verifyElementNotPresent
D. verifyElementPositionLeft
Ans: B

49. Select the tab which gives feedback and other useful information when executing tests.
A. Information
B. Feedback
C. Reference
D. Element
Ans: C

50. What is TestNG?
A. TestNextGeneration
B. TestNewGenerlization
C. TestNewGeneration
D. TestNextGenerations
Ans: A

SELENIUM Objective Questions pdf free download ::
51. Select the variation which finds elements based on the driver’s underlying CSS selector engine in Web driver Selenium.
A. By.cssSelected
B. By.cssSelection
C. By.cssSelector
D. By.Selectcs
Ans: C

52. Select the variation which locates elements by the value of the “name” attribute in Web driver Selenium
A. By.name
B. By.nametag
C. By.tagname
D. By.nametags
Ans: A

53. Select the tab that shows which command Selenium IDE is currently executing.
A. Variable
B. Data
C. Information
D. Info
Ans: D

54. Which is a faster component between the SeleniumWeb driver and Selenium RC?
A. Selenium RC
B. Selenium Web driver
Ans: B

55. Select the variation which locates elements by the value of their “id” attribute in Web Driver Selenium
A. By.id
B. By.idno
C. By.id_no
D. By.tag_id
Ans: A

56. Select the Get command which fetches the inner text of the element that you specify in Web driver Selenium.
A. getinnerText()
B. get_in_Text()
C. get_inner_Text()
D. getText()
Ans: D

57. Which Navigate command takes you forward by one page on the browser’s history in Web driver Selenium.
A. navigate.forward()
B. navigate().forward()
C. navigate()_forward()
D. navigate_forword()
Ans: B

58. Which method is used when you want to verify whether a certain check box, radio button, or option in a drop-down box is selected in Web driver Selenium
A. is_Selected()
B. isSelect()
C. isSelected()
D. is_Select()
Ans: C

59. Which Component is used to run multiple tests simultaneously in different browsers and platforms?
A. Selenium Grid
B. Selenium IDE
C. Selenium RC
D. Selenium Webdriver
Ans: A

60. Select the View which shows your script in HTML format.
A. The Table View
B. The Source View
C. The Editor View
D. The Field View
Ans: B

61. Select the method which clears all selected entries in Web driver Selenium.
A. dselectAll()
B. deselect_All()
C. dselect_All()
D. deselectAll()
Ans: D

62. Method which selects the option which displays the text matching the parameter passed to it
A. selectVisibleText()
B. selectByVisibleText()
C. select_VisibleText()
D. select_ByVisibleText()
Ans: B

63. Out of the following which is NOT a wait command.
A. waitForTitle
B. waitForTextPresent
C. waitForActive
D. waitForAlert
Ans: C

64. Select the command which retrieves the alert message and stores it in a variable that you will specify.
A. storeAlert
B. storedAlert
C. store_Alert
D. storesAlert
Ans: A

65. Select the method which performs a context-click at the current mouse location.
A. click_Context()
B. context.Click()
C. contextClick()
D. context_Click()
Ans: C

66. By Default time of WAITFOR command is :
A. 15 sec
B. 20 sec
C. 25 sec
D. 30 sec
Ans: D

67. Selenium is compatible with
A. CSS1.0 and CSS 2.0,
B. CSS1.0, CSS 2.0, and CSS 3.0 selectors.
C. CSS 2.0, and CSS 3.0 selectors.
D. CSS1.0, CSS 2.0, CSS 3.0 and CSS 4.0 selectors.
Ans: B

68. In Selenium variables are stored in _________ .
A. storedVars
B. storedVariables
C. VariablesStore
D. All of the above
Ans: A

69. Which command should be used to confirm that test will pass in the future, when new element is added after page loaded?
A. waitForElementPresent
B. pause
C. assertElementPresent
D. None of these
Ans: A

70. Which is the following is true in case of waitFor command?
A. waitForAlertPresent
B. waitForTextPresent
C. waitForFramePresent
D. waitForPageToLoad
Ans: B

71. How to execute specific command?
A. Highlight a command. Press Ctrl + F9.
B. Highlight a command. Press Alt + F9.
C. Highlight a command. Press Ctrl + X.
D. Highlight a command. Press X.
Ans: D

72. Which is odd one out?
A. ID
B. XPath
C. CSS selector
D. Pattern matching
Ans: D

73. Which command is used to extend the time limit of WAITFOR command?
A. Extend waitFor (time in sec)
B. waitFor (time in sec) extend
C. setTimeout (time in sec)
D. setTimeout.
Ans: D

74. ___________ finds the item ending with the value passed in. This is the equivalent to the XPath ends-with. Is concern with?
A. ^=
B. $=
C. *=
D. &=
Ans: B

75. In Selenium, Following Axis is related to:
A. Selects all the siblings after the current element
B. Selects all elements that follow the closing tab of the current elements.
C. Selects all of the siblings before the current element
D. Selects all elements that are before the current element
Ans: B

76. The // tells the query that
A. It needs to stop at the first element that it finds.
B. This is comment
C. The path of the file or folder
D. All of these
Ans: A

77. In regular Expression * quantifier refers to:
A. 0 or more of the preceding character.
B. 1 or more of the preceding character
C. 0 or 1 of the preceding character
D. All of these
Ans: A

78. Which regular expression sequence that loosely translates to “anything or nothing?”
A. .* (dot star)
B. *. (star dot)
C. “?
D. *+
Ans: A

79. Which is a procedure?
A. Wait
B. Exit
C. WaitForProperty
D. None of these.
Ans: A

80. Variable can be saved in which format?
A. ${variableName}
B. storedVars[‘variableName’].
C. Both of these
D. None of these
Ans: C

81. We use the dot (.) operator followed by either a * or a +. The + tells the regular expression that there will be instances between “0” and “n”, while the * tells the regular expression that there will be instances between “1” and “n”.
A. True
B. False
Ans: B

82. Applications do not have the items needed for the tests when the tests get to commands. To get around this, we had a look at adding fro waitFor commands to test. This is related to
A. Debugging tests
B. Working with AJAX applications
C. Working with multiple windows
D. All of these
Ans: B

83. What is the most common way to find an element on a page?
A. ID
B. XPath
C. CSS selector
D. Name
Ans:

84. Which is not true in case of Globs, in Selenium?
A. Globs are used as default pattern matching technique.
B. It is similar to regular expressions.
C. The syntax of Globs is much wider than Regular expression
D. B and C
Ans: C

85. Which process use the JavaScript to find an element?
A. By DOM query
B. BY XPath query
C. BY CSS sector
D. All of these
Ans: A

86. Which of the following is not verify and asserts method in Selenium?
A. VerifyElementPresent
B. VerifyElementNotPresent
C. VerifyText
D. VerifyTextAttributes
Ans: D

87. If you wanted to access the element that has the text “This element has an ID that changes every time the page is loaded” in it, then which of the following is used:
A. //div[contains(@id,’time_’)]
B. //div[contains(@id_time())]
C. //div[parameter(@id_time())]
D. //div[parameter(@id,’time_’)]
Ans: A

88. To delete a cookie we need to call the deleteCookie method, passing in two parameters.
A. The first parameter is the name of the cookie, and the second parameter is where it was created.
B. The first parameter is where it was created, and the second parameter is the name of cookie.
C. None of these
Ans: A

89. What is the default port number used by hub in selenium?
A. 4444
B. 2222
C. 1111
D. 3333
Ans: A

90. Which two commands you use to validate a button?
A. VerifyTextPresent and assertTextPresent
B. VerifyElementPresent and assertElementPresent
C. VerifyAlertPresent and assertAlertPresent
D. VerifyAlert and assertAlert
Ans: B

Latest Selenium IDE Objective type Questions for freshers

[UPDATED] 41 TOP Selenium IDE Interview Questions and Answers for freshers and experienced pdf


Real Time Selenium IDE Interview Questions and Answers PDF




=> Also Read Selenium IDE MCQs
1. What is Selenium IDE? 
• It is a Test Tool, used to Create and Execute Test Cases.
• It is Firefox plug in, works only on Firefox Browser.
• It provides Graphical user interface for Recording user actions using Firefox Browser.
• Firebug Add on is used to inspect elements.


2. What are the technical challenges with selenium?
As you know Selenium is a free ware open source testing tool. There are many challenges with Selenium.
–>Selenium Supports only web based applications
–>It doesn’t support any non web based (Like Win 32, Java Applet, Java Swing, .Net Client Server etc) applications
–>When you compare selenium with QTP, Silk Test, Test Partner and RFT, there are many challenges in terms of maintainability of the test cases
–>Since Selenium is a freeware tool, there is no direct support if one is in trouble with the support of applications
–>There is no object repository concept in Selenium, so maintainability of the objects is very high
–>There are many challenges if one have to interact with Win 32 windows even when you are working with Web based applications
–>Bitmap comparison is not supported by Selenium
–>Any reporting related capabilities, you need to depend on third party tools
–>You need to learn any one of the native language like (.Net, Java, Perl, Python, PHP, Ruby) to work efficiently with the scripting side of selenium

3. What are the test types supported by Selenium?
Selenium could be used for testing the web based applications.
The test types can be supported are:
1. Functional,
2. Regression,
3. Load testing
The automation tool could be implemented for post release validation with continuous integration tools like:
1. Jenkins,
2. Hudson,
3. Quick Build
4. CruiseCont



4. What are the capabilities of Selenium IDE?
Selenium IDE (Integrated Development Environment) works similar to commercial tools like QTP, Silk Test and Test Partner etc. The below mentioned points describes well about Selenium IDE.
1. Selenium IDE is a Firefox add-on.
2. Selenium IDE can support recording the clicks, typing, and other actions to make a test cases.
3. Using Selenium IDE A Tester can play back the test cases in the Firefox browser
4. Selenium IDE supports exporting the test cases and suites to Selenium RC.
5. debugging of the test cases with step-by-step can be done
6. Breakpoint insertion is possible
7. Page abstraction functionality is supported by Selenium IDE
8. Selenium IDE can support an extensibility capability allowing the use of add-ons or user extensions that expand the functionality of Selenium IDE


5. What are the challenges with Selenium IDE?
Selenium-IDE does not directly support:
1. Condition statements
2. Iteration or looping
3. Logging and reporting of test results
4. Error handling, particularly unexpected errors
5. Database testing
6. Test case grouping
7. Re-execution of failed tests
8. Test case dependency
9. Capture screenshots on test failures
10. Results Report generations

6. Which are the browsers supported by Selenium IDE?
Selenium IDE supports only one browser Mozilla Firefox. The versions supported as of now are:
Mozilla Firefox 2.x
Mozilla Firefox 3.x
The versions not supported as of now are:
earlier versions of Mozilla Firefox 2.x
Mozilla Firefox 4.x

7. How to execute a single line command from Selenium IDE?
Single line command from Selenium IDE can be executed in two ways
1. Right click on the command in Selenium IDE and select “Execute This Command”
2. Select the command in Selenium IDE and press “X” key on the keyboard

8. How to insert a start point in Selenium IDE?
Start point Selenium IDE can be set in two ways
1. Right click on the command in Selenium IDE and select “Set / Clear Start Point”
2. Select the command in Selenium IDE and press “S” key on the keyboard
3. You can have only one start point
4. If you have already set one start point and you selected other command as start point. Then the first start point will be removed and the new start point will be set

9. How to insert a comment in Selenium IDE?
Comments in Selenium IDE can be set in two ways
1. Right click on the command in Selenium IDE and select “Inert New Comment”
2. If you want to comment an existing line. You need to follow the below mentioned steps.
a. Select the source tab in IDE
b. Select the line which you want to comment
c. Assume that if you want to comment a open command you need to write like below mentioned code
<tr>
<!–
<td>open&l/td>
<td>/node/304/edit&l/td>
<td></td>
–>
</tr>

10. How to insert a break point in Selenium IDE?
Break point can be set in two ways in Selenium IDE
1. Right click on the command in Selenium IDE and select “Toggle Break Point”
2. Select the command in Selenium IDE and press “B” key on the keyboard
3. If you want to clear the break point once again Spress “B” key on the keyboard
4. You can set multiple break points in Selenium IDE

11. How to debug the tests in Selenium IDE?
To debug or execute the test cases line by line. Follow the below mentioned steps
1. Insert a break From the location where you want to execute step by step
2. Run the test case
3. Execution will be paused at the given break point
4. Click on the step (Blue) button to continue with the next statement
5. Click on Run button, to continue executing all the commands at a time

12. How to export the tests from Selenium IDE to Selenium RC in different languages?
From selenium IDE the test cases can be exported into the languages
1. .Net
2. Java
3. Perl
4. Python
5. PHP
6. Ruby
The below mentioned steps can explain how to export the test cases
1. Open the test case from Selenium IDE
2. Select File -> Export Test Case As

13. How to export Selenium IDE Test Suite to Selenium RC Suites?
From selenium IDE the test suites can be exported into the languages as mentioned below
1. .Net
2. Java
3. Perl
4. Python
5. PHP
6. Ruby
The below mentioned steps can explain how to export the test suites
1. Open the test case from Selenium IDE
2. Select File -> Export Test Suite As

14. Which is the command used for displaying the values of a variable into the output console or log?
The command used for displaying the values of a variable into the output console or log – echo
If you want to display a constant string. The below mentioned command can be used
echo <constant string>
ex: echo “The sample message”
If you want to display the value of a variable it can be written like below
echo ${<variable name>>
ex: echo ${var1}
Note: Here var1 is the variable

15. Which are the browsers supported by Selenium RC?
Supported browsers for Selenium RC include:
1. *firefox
2. *mock
3. *firefoxproxy
4. *pifirefox
5. *chrome
6. *iexploreproxy
7. *iexplore
8. *firefox3
9. *safariproxy
10. *googlechrome
11. *konqueror
12. *firefox2
13. *safari
14. *piiexplore
15. *firefoxchrome
16. *opera
17. *iehta
18. *custom

16. Which are the Operating Systems supported by Selenium?
Selenium IDE
Works in Firefox 2+ Start browser, run tests Run tests
Operating Systems Supported:
1. Windows,
2. OS X
3. Linux
4. Solaris
5. Others whichever supports Firefox 2+
Selenium Remote Control
Used for starting browser and run tests
Operating Systems Supported:
1. Windows,
2. OS X
3. Linux
4. Solaris
5. Others
Selenium Core
Used for running tests
Operating Systems Supported:
1. Windows,
2. OS X
3. Linux
4. Solaris
5. Others

17. What is Selenium RC?
Selenium-RC is the solution for tests that need a little more than just simple browser actions and a linear execution. Selenium-RC leverages the full power of programming languages, creating tests that can do things like read and write external files, make queries to a database, send emails with test reports, and practically anything else a user can do with a normal application.
You will want to use Selenium-RC whenever your test requires logic not supported by running a script from Selenium-IDE

18. Why Selenium RC is used?
Selenium-IDE does not directly support:
1. condition statements
2. iteration
3. logging and reporting of test results
4. error handling, particularly unexpected errors
5. database testing
6. test case grouping
7. re-execution of failed tests
8. test case dependency
9. capture screenshots on test failures
The reason behind why Selenium-IDE does not support the above mentioned requirements is IDE supports only HTML language. Using HTML language we cannot achieve the above mentioned requirements. Because HTML does not support conditional, looping and external source connectives.
To overcome the above mentioned problems Selenium RC is used.
Since Selenium RC supports the languages .Net, Java, Perl, Python, PHP, and Ruby. In these languages we can write the programme to achieve the IDE issues

19. Which are the languages supported by Selenium RC?
The languages supported by Selenium RC
1. .Net,
2. Java (Junt 3, Junt 4, TestNG, Groovy)
3. Perl,
4. Python,
5. PHP,
6. Ruby

20. What is Selenium Grid?
Selenium Grid is part of Selenium suite of projects. Selenium Grid transparently distribute your tests on multiple machines so that you can run your tests in parallel, cutting down the time required for running in-browser test suites. This will dramatically speeds up in-browser web testing, giving you quick and accurate feedback you can rely on to improve your web application.

21. What is Selenium WebDriver or Google WebDriver or Selenium 2.0?
WebDriver uses a different underlying framework from Selenium’s javascript Selenium-Core. It also provides an alternative API with functionality not supported in Selenium-RC. WebDriver does not depend on a javascript core embedded within the browser, therefore it is able to avoid some long-running Selenium limitations.
WebDriver’s goal is to provide an API that establishes
• A well-designed standard programming interface for web-app testing.
• Improved consistency between browsers.
• Additional functionality addressing testing problems not well-supported in Selenium 1.0.
The Selenium developers strive to continuously improve Selenium. Integrating WebDriver is another step in that process. The developers of Selenium and of WebDriver felt they could make significant gains for the Open Source test automation community be combining forces and merging their ideas and technologies. Integrating WebDriver into Selenium is the current result of those efforts.

22. What are the capabilities of Selenium WebDriver or Google WebDriver or Selenium 2.0?
One should use WebDriver when requiring improved support for
• Mult-browser testing including improved functionality for browsers not well-supported by Selenium-1.0.
• Handling multiple frames, multiple browser windows, popups, and alerts.
• Page navigation.
• Drag-and-drop.
• AJAX-based UI elements.

23. What is the architecture of Selenium RC?
The Selenium Server which launches and kills browsers, and acts as an HTTP proxy for browser requests.
Client libraries for various programming languages, each of which instructs the Selenium Server in how to test the AUT by passing it your test script’s Selenium commands.
The diagram shows the client libraries communicate with the Server passing each Selenium command for execution. Then the server passes the Selenium command to the browser using Selenium-Core JavaScript commands. The browser, using its JavaScript interpreter, executes the Selenium command, which effectively, runs the check you specified in your Selenese test script.

24. What is the architecture of Selenium Grid?
The below mentioned theory explains about the setup of Selenium Grid with architecture and how it works.
Selenium Grid builds on the traditional Selenium setup, taking advantage of the following properties:
* The Selenium test, the application under test, and the remote control/browser pair do not have to be co-located. They communicate through HTTP, so they can all live on different machines.
* The Selenium tests and the web application under test are obviously specific to a particular project. Nevertheless, neither the Selenium remote control nor the browser is tied to a specific application. As a matter of fact, they provide a capacity that can easily be shared by multiple applications and multiple projects.
Consequently, if only we could build a distributed grid of Selenium Remote Controls, we could easily share it across builds, applications, projects – even potentially across organizations. Of course we would also need to address the scalability issues as described earlier when covering the traditional Selenium setup. This is why we need a component in charge of:
* Allocating a Selenium Remote Control to a specific test (transparently)
* Limiting the number of concurrent test runs on each Remote Control
* Shielding the tests from the actual grid infrastructure
Selenium Grid calls this component the Selenium Hub.
* The Hub exposes an external interface that is exactly the same as the one of a traditional Remote Control. This means that a test suite can transparently target a regular Remote Control or a Selenium Hub with no code change. It just needs to target a different IP address. This is important as it shields the tests from the grid infrastructure (which you can scale transparently). This also makes the developer’s life easier. The same test can be run locally on a developer machine, or run on a heavy duty distributed grid as part of a build – without ever changing a line of code.
* The Hub allocates Selenium Remote Controls to each test. The Hub is also in charge of routing the Selenese requests from the tests to the appropriate Remote Control as well as keeping track of testing sessions.
* When a new test starts, the Hub puts its first request on hold if there is no available Remote Control in the grid providing the appropriate capabilities. As soon as a suitable Remote Control becomes available, the Hub will serve the request. For the whole time, the tests do not have to be aware of what is happening within the grid; it is just waiting for an HTTP response to come back.

25. Does Selenium support mobile internet testing?
Selenium supports Opera. And opera is used in most of the Smart phones. So whichever Smart phone supports opera, selenium can be used to test. So, one can use Selenium RC to run the tests on mobiles.

26. Does Selenium support Google Android Operating System?
Yes, Selenium Web Driver or Google Web Driver or Selenium 2.0 supports Android Operating System. There are several libraries written to support Android Operating System.

27. What are the types of text patterns available in Selenium?
There are three types of patterns available in Selenium
1. globbing
2. regular expressions
3. exact

28. How to use regular expressions in Selenium?
Regular expressions in Selenium IDE can be used with the keyword – regexp: as a prefix to the value and patterns needs to be included for the expected values.
For example if you want to use the regular expression for a command
Command: verifyText
Target: //font/font/b/font[1]
Value: Flight Confirmation # 2011-05-02451
in the above example Flight Confirmation is continuously changing each time you run the test case. So this can be written with a regular expression as mentioned below
Command: verifyText
Target: //font/font/b/font[1]
Value: regexp:Flight Confirmation # [0-9]{4}-[0-9]{2}-[0-9]{5,10}

29. What are the regular expression patterns available in Selenium?
Selenium regular expression patterns offer the same wide array of special characters that exist in JavaScript. Below are a subset of those special characters
PATTERNMATCH
.any single character
[ ]character class: any single character that appears inside the brackets
*quantifier: 0 or more of the preceding character (or group)
+quantifier: 1 or more of the preceding character (or group)
?quantifier: 0 or 1 of the preceding character (or group)
{1,5}quantifier: 1 through 5 of the preceding character (or group)
|alternation: the character/group on the left or the character/group on the right
( )grouping: often used with alternation and/or quantifier

30. What is Selenese?
Selenium set of commands which are used for running the test are called as Selenese.
There are three types of Selenese, those are:
1. Actions – used for performing the operations and interactions with the target elements
2. Assertions – used as check points
3. Accessors – used for storing the values in a variable

31. How do you add check points or verification points in Selenium?
check points or verification points are known as Assertions in Selenium. The keywords with below mentioned prefix will be used for adding check points or verification points.
1. verify
2. assert
3. waitFor

32. What is Assertion in Selenium?
Assertion is nothing but a check or verification point.
Assertion verifies the state of the application conforms to what is expected.
Examples include “make sure the page title is X” and “verify that this checkbox is checked.

33. What are the types of Assertions there in Selenium?
Selenium Assertions can be used in 3 modes:
1) assert – When an “assert” fails, the test will be aborted. If you are executing test suite, the next state case will start
2) verify – When a “verify” fails, the test will continue execution, logging the failure.
3) waitFor – “waitFor” commands wait for some condition to become true (which can be useful for testing Ajax applications). They will succeed immediately if the condition is already true. However, they will fail and halt the test if the condition does not become true within the current timeout setting

34. When to use Assert, Verify and WaitFor in Selenium?
1) assert – If the expected value is mandatory to continue with the next set of steps we will use Assert. As Assert aborts the test, if the expected value doesn’t match. It is good to use for any mandatory checks.
2) verify – If the expected value is optional to continue with the next set of steps we will use Verify. As Verify continues executing with the next set of steps, if the expected value doesn’t match. It is good to use for any optional checks.
3) waitFor – If your test needs to wait, if the expected value is not matching we use waitFor. We normally use waitFor for AJAX kind of controls loading within a page

35. What is an Accessor in Selenium?
Accessor is one of the type of Selenese.
I. Accessors are used for storing the value of a target in a variable.
Ex:
1) storeTitle – Stores the title of a window in a variable
2) storeText – Stores the target element text in a variable
II. Accessors are also used for evaluating the result and storing the result in a variable
Ex: storeTextPresent – Evaluates whether the text is present in the current window. If the text is present stores true in the variable else stores false
Ex: storeEementPresent – Evaluates whether the element is present in the current window. If the element is present stores true in the variable else stores false

36. When to use Accessors in Selenium?
Accessors are mostly used for storing the value in a variable.
The variable can be used for following reasons:
1) To get the value from an element and comparing with some dynamic value
2) To take a logical decision to execute the test steps
ex: if the value of the variable true execute step1 and step2 else step3 and step4
3) To execute some statements in a loop based on the value returned by the element

37. How to capture bitmaps in Selenium?
Bitmaps are captured using the Selenium set of commands. There are two modes of capturing the bitmaps
1) Capture the bitmap for the entire page – it captures the browser main page area of AUT
2) Capture the bitmap for the screen shots – it captures the entire screen shot like the print scree that you give from your keyboard
Selenium doesn’t support bitmap capturing for an element on AUT.

38. Which are the commands used for capturing the bitmaps?
captureEntirePageScreenshot
Saves the entire contents of the current window canvas to a PNG file. Contrast this with the captureScreenshot command, which captures the contents of the OS viewport (i.e. whatever is currently being displayed on the monitor), and is implemented in the RC only. Currently this only works in Firefox when running in chrome mode, and in IE non-HTA using the EXPERIMENTAL “Snapsie” utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension. Please see captureEntirePageScreenshot for more details
captureEntirePageScreenshotAndWait
Saves the entire contents of the current window canvas to a PNG file. Contrast this with the captureScreenshot command, which captures the contents of the OS viewport (i.e. whatever is currently being displayed on the monitor), and is implemented in the RC only. Currently this only works in Firefox when running in chrome mode, and in IE non-HTA using the EXPERIMENTAL “Snapsie” utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension. Please see
captureEntirePageScreenshotAndWait for details.
Note: This command runs with only mozilla firefox when you run the tests from RC. Other browsers it will not support

39. What is the difference between captureEntirePageScreenshot and CaptureScreenShot?
captureEntirePageScreenshot
1. This captures the AUT web page only
2. This supports only mozilla firefox
3. Accepts two arguments. one is the file name to be saved and other argument is back ground color
CaptureScreenShot
1. This captures the System screen shot
2. This supports all the browsers when you run from Selenium RC
3. Accepts one argument. That is the file name to be saved.

40. How do you set user extensions in Selenium IDE?
1. Open user-extensions.js with an editor (Notepad, etc.); it’s found in the selenium\core\scripts folder. If it doesn’t exist, just create it.
2. If you need to, commit the user-extensions.js file (like if you use subversion).
3. Open Selenium IDE and choose the Options menu and then Options… from that menu.
4. Make sure the path to your user-extensions.js file is entered in the Selenium Core extensions field (like \selenium\core\scripts\user-extensions.js)
5. Press OK button on options
6. Restart the IDE to reflect your extensions.
Note: After reopen, Selenium IDE may show compilations errors if the user-extensions.js file has any syntax errors.

41. What are the limitations of Selenium IDE
The limitations of Selenium IDE are:
1) Selenium IDE uses only HTML language
2) Conditional or branching statements execution like using of if, select statements is not possible
3) Looping statements using is not possible directly in Selenium HTML language in ide
4) Reading from external files like .txt, .xls is not possible
5) Reading from the external databases is not possible with ide
6) Exceptional handling is not there
7) A neat formatted Reporting is not possible with ide
To eliminate the above issues we use Selenium RC

Latest Selenium IDE Interview Questions for freshers and Experienced pdf