Created
May 15, 2019 14:43
-
-
Save WryanBrock/14ea66b4c98e49a7870e8b1481ee3f76 to your computer and use it in GitHub Desktop.
IE 11 java windows 10 failing with .size() added
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 scraperBlocks; | |
import java.io.File; | |
import java.util.concurrent.TimeUnit; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.ie.InternetExplorerDriver; | |
import org.openqa.selenium.ie.InternetExplorerOptions; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.support.ui.ExpectedConditions; | |
import org.openqa.selenium.support.ui.WebDriverWait; | |
public class iescraper { | |
@SuppressWarnings("deprecation") | |
public static void main(String[] args) { | |
File ieFile = new File("C:\\Users\\seymo\\Desktop\\Projects\\Drivers\\IEDriverServer.exe"); | |
System.setProperty("webdriver.ie.driver", ieFile.getAbsolutePath()); | |
DesiredCapabilities ieCaps = DesiredCapabilities.internetExplorer(); | |
WebDriver driver = new InternetExplorerDriver(); | |
ieCaps.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, "https://www.google.com/"); | |
driver = new InternetExplorerDriver(ieCaps); | |
WebDriverWait wait = new WebDriverWait(driver, 20); | |
//some operations on that site | |
System.out.println(driver.findElements(By.cssSelector("input")).size()); | |
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.name("q"))); | |
element.clear(); | |
WebElement selement = wait.until(ExpectedConditions.elementToBeClickable(By.name("q"))); | |
selement.sendKeys("Ripon Al Wasim"); | |
WebElement felement = wait.until(ExpectedConditions.elementToBeClickable(By.name("btnK"))); | |
felement.click(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment