Selenium Cmds
Selenium Cmds
Selenium Cmds
driver.manage.window.setsize();
10.classname();
11.linkText();
12.cssselector();
13.Partiallinktext();
14.Clear();
15.getText();
System.out.println(text);
16.getTitle();
System.out.println(title);
17.getCurrentUrl();
System.out.println(url);
18.close();
19.quit();
20.getAttribute();
String textOnButton =
driver.findElement(By.xpath("//*[@id=\"BlogSearch1_form\"]/form/table/tbody/tr/
td[2]/input")).getAttribute("value");
System.out.println(textOnButton);
21.isDisplayed();
System.out.println(driver.findElement(By.xpath("//input[@class='gsc-search-
button'][@type='submit']")).isDisplayed());
22.isEnabled();
System.out.println(driver.findElement(By.id("but2")).isEnabled());
23.isSelected();
System.out.println(driver.findElement(By.id("checkbox1")).isSelected());
24.getScreenshotAs();
File srcScreenshot =
driver.findElement(By.name("search")).getScreenshotAs(OutputType.FILE);
FileHandler.copy(srcScreenshot, new
File(System.getProperty("user.dir")+"\\screenshot.png"));
25.getPageSource();
System.out.println(pageGetSource);
26.navigate();
27.submit();
driver.findElement(By.id("input-email")).sendKeys("arun.selenium@gmail.com");
Thread.sleep(5000);
driver.findElement(By.id("input-password")).sendKeys("Second@123");
Thread.sleep(5000);
driver.findElement(By.id("input-password")).submit();
28.getTagName();
System.out.println(tagName);
29.getSize();
org.openqa.selenium.Dimension dimension =
driver.findElement(By.name("search")).getSize();
driver.quit();
30.getLocation();
31.xPath();
driver.findElement(By.xpath("//button[@type='button'][@class='btn btn-default
btn-lg']")).click();
32.findElements();
for(WebElement element:elements) {
System.out.println(element.getText());
}
33.tagName();
System.out.println(element.getText());
}
34.getCSSValue();
String lineheightForHomeOption =
driver.findElement(By.id("home")).getCssValue("line-height");
System.out.println(lineheightForHomeOption);
driver.quit();
35.getClass();
System.out.println(driverObjectReferenceClass);
driver.quit();
36.getWindowHandle(),getWindowHandles,switchTo(),window();
Thread.sleep(5000);
Thread.sleep(5000);
while(itr.hasNext()) {
driver.switchTo().window(window);
driver.close();
}
}
driver.switchTo().window(firstWindow);
driver.findElement(By.name("q")).sendKeys("Abdul Shaikh");
select.selectByVisibleText("doc 3");
38.selectByIndex();
select.selectByIndex(1);
39.selectByValue();
select.selectByValue();
40.isMultiple();
System.out.println(select.isMultiple);
41.frame();
driver.switchTo().frame(frameOfChapter3);
driver.findElement(By.linkText("Chapter3")).click();
42.parentFrame();
driver.switchTo().frame("");
driver.switchTo().frame(0);
String textInsideBlueBox =
driver.findElement(By.xpath("//h1")).getText();
System.out.println(textInsideBlueBox);
driver.quit();
43.defaultContent();
44.pageLoadTimeout();
driver.manage().timeouts().pageLoadTimeout(5, TimeUnit.SECONDS);
45.setScriptTimeout();
driver.manage().timeouts().setScriptTimeout(10, TimeUnit.SECONDS);
46.implicitlyWait();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
//driver.findElement(By.className("dropbtn")).click();
//wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Facebook
")));
//driver.findElement(By.linkText("Facebook")).click();
48.elementToBeClickable();
driver.findElement(By.xpath("//
button[@onclick='setTimeout(myFunctionAXD,10000)']")).click();
wait.until(ExpectedConditions.elementToBeClickable(By.id("dte")));
driver.findElement(By.id("dte")).click();
49.invisibilityOfElementLocated();
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("deletesuccess"
)));
driver.findElement(By.id("alert2")).click();
50.alert(),getText(),accept(),dismiss();
driver.findElement(By.id("alert1")).click();
Thread.sleep(5000);
System.out.println(textOnAlert);
Thread.sleep(5000);
alert.accept();
driver.quit();
51.alertIsPresent();
wait.until(ExpectedConditions.alertIsPresent());
alert.accept();
//driver.findElement(By.id("prompt")).click();
//Thread.sleep(5000);
//Thread.sleep(5000);
//alert.sendKeys("Abdul Shaikh");
53.moveToElement();
actions.moveToElement(blogsMenu).build().perform();
actions.moveToElement(clickToGetAlertButton).click().build().perform();
55.dragAndDropBy()
WebElement minOption = driver.findElement(By.xpath("//a[@aria-labelledby='price-
min-label']"));
actions.contextClick(searchBoxField).build().perform();
57.switchTo()
58.executeScript()
js.executeScript("alert('Abdul Shaikh');");
59.executeAsyncScript()
js.executeAsyncScript("window.setTimeout(function()
{alert('world');},4000);alert('Hello);");
60.getCookies()
System.out.println("------------------------------------");
}
61.getCookieNamed()
62.addCookie()
driver.manage().addCookie(cookie);
63.deleteCookieNamed()
driver.manage().deleteCookieNamed("OCSESSID");
64.deleteCookie()
driver.manage().deleteCookie(cookie);