Default Path
Specified Path
close() or quit()
maximize()
SetSize()
get()
navigate().to() and navigate().to().back()/forward()
Locate one object
Locate multiple objects
sendKeys()
clear()
click()
Locate father div tag and then to locate all the following objects
Hiberarchy
Alert Class
Alert, Confirm and Prompt
switchTo().alert()
getText()
accept() and dismiss()
switchTo().frame()
switchTo().defaultContent()
Class:Select
select.selectByIndex("index");
select.selectByValue("value");
domain,name,value,expriy,path
driver.manage().addCookie();
driver.manage().getCookie();
dr.manage().deleteCookieNamed("Cookies Name");
dr.manage().deleteCookie("CookieName");
dr.manage().deleteAllCookies();
-
import org.openqa.selenium.TakesScreenshot; File screenshotFile = ((TakesScreenshot)dr).getScreenshotAs(OutputType.FILE);
add new profile
use existing profile
temporary sepecified plug-in
enable function
firefox proxy setting
getAttribute(); getText(); getCssValue();
isDisplayed(); isSelected(); isEnabled();
-
JavascriptExecutor)dr).executeScript("alert(\"hello,this is a alert!\")"); ((JavascriptExecutor)dr).executeScript("$(arguments[0]).fadeOut();", button); -
(new Actions(dr)).dragAndDrop(from,to).perform();
Other operations in Action Class (KeyDown, KeyUp, Click,sendKeys,doubleClick,clickAndHold, release,moveToElement, contextClick)
File Class
sendKeys
setPreference
explicit wait
explicit_wait.until(new ExpectedCondition<WebElement>(){
@Override
public WebElement apply(WebDriver d){
return d.findElement(By.id("b"));
}
}).click();
implicit wait
dr.manage().timeouts().pageLoadTimeout(5, TimeUnit.SECONDS);