Uruchomienie web drivera z silnikiem Internet Explorer

0

Mam taki kod:

import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.junit.*;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.*;

import java.time.Duration;

public class SearchTestOnIE {
    public WebDriver driver;

	@SuppressWarnings("deprecation")
	@Before
	public void setUp() {
		System.setProperty("webdriver.ie.driver",
				"./src/test/resources/drivers/IEDriverServer.exe");

		DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
		caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);

        driver = new InternetExplorerDriver(caps);

i pom.xml:

<dependencies>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.47.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.9.4</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>3.4</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.12</version>
        <scope>test</scope>
    </dependency>
    <!-- <dependency> <groupId>com.github.detro</groupId> <artifactId>phantomjsdriver</artifactId>
        <version>1.2.0</version> <scope>test</scope> </dependency> -->
    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>3.1.0</version>
        <scope>test</scope>
    </dependency>
</dependencies>

Wyskakuje błąd:

java: cannot find symbol
  symbol:   method internetExplorer()
  location: class org.openqa.selenium.remote.DesiredCapabilities

Jakaś rada?

0

jedyne co mi przychodzi do głowy to sprawdź czy przypadkiem nie robisz jar-shadowing np. nowsza wersja jara nie ma metody internetExplorer() a starsza wersja ją posiada. I pomimo, że odpalasz z wersją starszą, to gdzieś w drzewku zależności odpala się inna wesja jara i przesłania

0

Dzięki.

1 użytkowników online, w tym zalogowanych: 0, gości: 1