使用Jdk 10和氧气3a

时间:2018-04-24 19:45:33

标签: java

在以下程序中,第2和第3个import语句出现以下语句错误 - 可以从多个模块访问org.openqa.selenium包:client.combined,com.google.common。

以下是我添加到模块路径的jar文件。

Jar Files included in Module Path

Program with errors

After compilation

该程序使用jdk 9和氧气成功运行。但它现在失败了。请告诉我在项目中使用webdriver可以做些什么更正。

先谢谢。

package javaExamples;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;



public class FirstTrial {
        WebDriver driver;   
        JavascriptExecutor jse;

        public void invokeBrowser() {

            try {
                System.setProperty("webdriver.chrome.driver",
                        "C:\\Selenium\\chromedriver_win32_2018_april\\chromedriver.exe");
                driver = new ChromeDriver();
                driver.manage().deleteAllCookies();
                driver.manage().window().maximize();
                driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);// allows system to wait max 30 secs if it
                                                                                // completes before its fine
                driver.get("http://www.edureka.co");
                searchBrowser();
            } catch (Exception e) {

                e.printStackTrace();
            }
        }

        public void searchBrowser() {
            driver.findElement(By.id("homeSearchBar")).sendKeys("java");
            // Thread.sleep(2000);//allows to wait for 2 secs. This is
explicit wait. System           // must sleep for 2 secs
            driver.findElement(By.id("homeSearchBarIcon")).click();

            jse = (JavascriptExecutor) driver;
            jse.executeScript("scroll(0,600)");

            driver.findElement(By.xpath("//label[contains(text(),'Weekend')]")).click();

        }

        public static void main(String[] args) {

            FirstTrial myobj = new FirstTrial();
            myobj.invokeBrowser();
        }

    }

0 个答案:

没有答案
相关问题