Professional Documents
Culture Documents
Browser Commands
RadioButton
ID
Get command
isSelected
Name
Link Text
To Command
Refresh Command
Close Command
Back Command
Forward Command
Text
Quit Command
DOM - GetElementById,
GetElementByName,dom:name,dom:index
XPATH
Switch Commands
Refresh Command
driver.switchTo.window("WindowName")
driver.switchTo.frame("FrameName")
testNG Annotations
@Test
@Before
@AferM
@BeforeCl
Method
ethod
ass
@Before
@AfterGr
@Before
@AfterTest
Group
oup
Test
@AfterSuite
considered as element
considered as
conditional wait,
and is applied to a
@Before
particular Web
Suite
Web Elements on a
Element with a
page.
condition
WebDriverWait
wait = new
element is available to
WebDriverWait(Dri
not Selected
driver.SwitchTo.alert()
CheckBox
Checked
not Checked
Eg : Absolute path
By Id
:/html/body/form/div/div[3]/[p1]/a
ver, 90);
By Name
Driver.manage().timeouts
wait.until(Expected
By Class Name
().implicitlyWait(90,
Conditions.visibility
TimeUnit.SECONDS);
OfElementsLocated
By Tag Name
By(By.xpath("//input[
@type='text']")));
By Link Text
DropDown
By CSS
By Xpath
selectByVisibleText
selectByIndex
selectByValue
findElement Vs findElements
Returns a single
Returns List of
WebElement
WebElements.
Syntax:
Syntax:
WebElement
java.util.List<WebElement
findElement(By
by)
Exception
Exception:emptyListofWeb
:NoSuchElementE
ElementObject
xception
By Rajesh (rajeshcdp)
Sponsored by CrosswordCheats.com
cheatography.com/rajeshcdp/
Page 1 of 1.
http://crosswordcheats.com