Last active
December 20, 2015 19:29
-
-
Save barancev/6183820 to your computer and use it in GitHub Desktop.
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); | |
System.out.println("fileinput.isDisplayedAgain(); " + fileinput.isDisplayed()); | |
fileinput.click(); | |
fileinput.sendKeys("C:\\temp\\test.py"); | |
//driver.quit(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment