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 org.testng.annotations.* | |
import org.testng.TestNG | |
import org.testng.TestListenerAdapter | |
@Grab(group='org.testng', module='testng', version='5.7', classifier='jdk15') | |
class HogeTest { | |
@Test | |
void add() { | |
assert 1 + 1 == 2 | |
} |
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 WebElement waitFindElement(WebDriver drv, By by, long timeout, long interval) | |
{ | |
long start = System.currentTimeMillis(); | |
while(true){ | |
try{ | |
return drv.findElement(by); | |
} catch(NoSuchElementException nse) { | |
if(System.currentTimeMillis()-start>=timeout) | |
{ | |
throw new Error("Timeout reached and element["+by+"]not found"); |
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.List | |
import static extension java.util.Collections.* | |
class CollectionFilter { | |
def static void main(String[] _) { | |
val values = new ArrayList( 1, 5, 33, 0, -2, -10, 4, 36, -82 ) | |
positiveOnly( values ) | |
negativeOnly( values ) |
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
private ExpectedCondition<Boolean> element(final By findCondition) { | |
return new ExpectedCondition<Boolean>() { | |
@Override | |
public Boolean apply(WebDriver from) { | |
RenderedWebElement element = (RenderedWebElement) | |
driver.findElement(findCondition); | |
return element.isDisplayed(); | |
} | |
}; | |
} |
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 mouseClickByLocator( String cssLocator ) { | |
String locator = cssLocator; | |
WebElement el = driver.findElement( By.cssSelector( locator ) ); | |
Actions builder = new Actions(driver); | |
builder.moveToElement( el ).click( el ); | |
builder.perform(); | |
} |
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
#!/bin/sh | |
# Load JBoss AS init.d configuration. | |
if [ -z "$JBOSS_CONF" ]; then | |
JBOSS_CONF="/etc/jboss-as/server-jboss7.conf" | |
fi | |
# source the JBoss config file | |
[ -r "$JBOSS_CONF" ] && . "${JBOSS_CONF}" |
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
create user usr_name identified by [pass***word] profile usr_profile default tablespace usr_ts temporary tablespace temp quota unlimited on usr_ts account unlock | |
grant create session to usr_name | |
grant create table to usr_name | |
grant create view to usr_name | |
grant create sequence to usr_name | |
grant create procedure to usr_name | |
grant create database link to usr_name |
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.IOException; | |
import java.net.URL; | |
import org.apache.commons.io.FileUtils; | |
import org.junit.Assert; | |
import org.junit.Test; | |
import org.openqa.selenium.OutputType; | |
import org.openqa.selenium.Platform; | |
import org.openqa.selenium.TakesScreenshot; |
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
package com.yahoo.media.mediaqa.selenium2test; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.remote.RemoteWebDriver; | |
import org.openqa.selenium.android.AndroidDriver; | |
import org.openqa.selenium.firefox.*; | |
import org.openqa.selenium.firefox.internal.ProfilesIni; |
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 void authenticate() { | |
this.authenticateButton.click(); | |
new WebDriverWait(driver, 30).until(authenticated()); | |
} | |
private Predicate<WebDriver> authenticated() { | |
return new Predicate<WebDriver>() { | |
@Override public boolean apply(WebDriver driver) { | |
return isAuthenticated(); | |
} |
OlderNewer