FAQs

Selenium Webdriver can be used with a variety of browsers such as 
									
Internet Explorer
Mozilla Firefox
Google Chrome
Safari
Opera

Languages that are supported by Selenium WebDriver are  

C#
Java
Perl
PHP
Python 
Ruby

Id
Name
Link Text
Partial Link Text
Tag Name
CSS Class
CSS Selector
XPath

Get command is used to retrieve the inner text of the specified web element.
									
Syntax:

	String text = driver.findElement(By.id(“Element_ID”)).getText();
									

When an "assert" command fails then test execution will be aborted.
So when the Assertion fails, all the test steps after that line of code are skipped.
When an "verify" command fails, it will fail the test but continue to run the test case
									

In a textbox typed text goes into the value attribute.
findElement(By.id("TextBoxid")).getAttribute("value");

For ComboBox is a bit different. But if you're using the Select object you can use the method:

Select selectItem = new Select(findElement(By.id("someid")));
selectItem.getFirstSelectedOption().getText();
								   

driver.findElement(By.Xpath("//img[@ src='images/shim.gif']")).click();

FirefoxDriver
InternetExplorerDriver
ChromeDriver
SafariDriver
OperaDriver
AndroidDriver
IPhoneDriver
HtmlUnitDriver

Selenium Web driver provides two types of waits

Implicit waits

Explicit waits

Implicit Wait:  An implicit wait is to tell Web Driver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available.The default setting is 0. Once set, the implicit wait is set for the life of the Web Driver object instance until it changed again. This means that we can tell Selenium that we would like it to wait for a certain amount of time before throwing an exception that if it cannot find the element on the page.
The implicit wait is set for the life of the WebDriver object instance.
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Refer Selenium Explicit and Implicit Waits        (with hyperlink http://brightitcareer.com/testing/selenium/selenium_webdriver_waits.html) This link should not be visible, you just need to assign this link to the linkText

Explicit Wait: An explicit waits is code you define to wait for a certain condition to occur before proceeding further in the code. The worst case of this is time.sleep(), which sets the condition to an exact time period to wait. There are some convenience methods provided that help you write code that will wait only as long as required. WebDriverWait in combination with ExpectedCondition is one way this can be accomplished.
Refer Selenium Explicit and Implicit Waits        (with hyperlink http://brightitcareer.com/testing/selenium/selenium_webdriver_waits.html) 

WebDriver provides the APIs to check the visibility of the web elements on the web page. 
These web elements can be buttons, drop boxes, checkboxes, radio buttons, labels etc.

isDisplayed()
isSelected()
isEnabled()
Syntax:
isDisplayed():
boolean elementPresent = driver.findElement(By.id(“element_Id”)).isDisplayed();
isSelected():
boolean elementSelected = driver.findElement(By.id(“element_Id”)).isSelected();
isEnabled():
boolean elementEnabled = driver.findElement(By.id(“element_Id”)).isEnabled();

Stay in the loop with our newsletter!