This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebDriver driver = new FirefoxDriver(); | |
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); | |
driver.get("http://rap.eclipsesource.com/workbenchdemo/rms"); | |
driver.findElement(By.xpath("//div[text() = 'do it']")).click(); | |
driver.findElement(By.xpath("//div[text() = 'Intro']")).click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<select name="select" onblur="document.getElementById('blur').textContent='blur'"> | |
<option value="1">test 1</option> | |
<option value="2">test 2</option> | |
<option value="3">test 3</option> | |
</select> | |
<p id="blur"></p> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style type="text/css"> | |
#invisible-with-children { | |
background-color:green; | |
height:100px; | |
width:100px; | |
overflow:hidden; | |
} | |
#invisible-parent { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws Exception { | |
WebDriver driver = new FirefoxDriver(); | |
driver.get("http://jasny.github.io/bootstrap/javascript.html#fileupload"); | |
JavascriptExecutor jse = (JavascriptExecutor) driver; | |
WebElement navbar = driver.findElement(By.cssSelector(".navbar ")); | |
jse.executeScript("arguments[0].style.display='none'", navbar); | |
WebElement fileinput=driver.findElement(By.cssSelector("#fileupload .bs-docs-example input[type='file']")); | |
jse.executeScript("arguments[0].style.opacity=1", fileinput); | |
jse.executeScript("arguments[0].style['transform']='translate(0px, 0px) scale(1)'", fileinput); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.net.URISyntaxException; | |
import java.net.UnknownHostException; | |
import java.text.SimpleDateFormat; | |
import java.util.*; | |
import org.browsermob.core.har.Har; | |
import org.browsermob.proxy.ProxyServer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* setters-style: */ | |
// CommonOptions implements Options | |
CommonOptions commonOptions = new CommonOptions(); | |
commonOptions.setProxy(...); | |
commonOptions.setOption("randomKey", "randomValue"); | |
// FirefoxOptions implements Options | |
FirefoxOptions firefoxOptions = new FirefoxOptions(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Random; | |
public class Test { | |
public static void main(String[] args) { | |
List<String> stringList = Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h"); | |
String s = pickRandom(stringList); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebDriver original = new FirefoxDriver(); | |
SimpleUnhandledAlertHandler handler = new SimpleUnhandledAlertHandler(); | |
UnhandledAlertHandlingWrapper wrapper = new UnhandledAlertHandlingWrapper(original); | |
wrapper.registerAlertHandler(handler); | |
WebDriver driver = wrapper.getDriver(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InternetExplorerDriverService service = new InternetExplorerDriverService.Builder() | |
.withLogLevel(InternetExplorerDriverLogLevel.TRACE) | |
.withLogFile(new File("iedriver.log")) | |
.build(); | |
InternetExplorerDriver driver = new InternetExplorerDriver(service); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FirefoxProfile profile = new FirefoxProfile(); | |
profile.setPreference(FirefoxProfile.ALLOWED_HOSTS_PREFERENCE, "alias1,alias2"); | |
WebDriver driver = new FirefoxDriver(profile); |
OlderNewer