selenium 2 chrome driver

后端 未结 10 593
情书的邮戳
情书的邮戳 2020-12-05 03:23

So I have read all the docs on adding chromedriver to my path and followed all of them. I am on a Mac with selenium2, maven, eclipse, and all the latest drivers:

<         


        
10条回答
  •  时光取名叫无心
    2020-12-05 03:41

        Pom.xml code and Selenium code below:
    
    
       com.HelloWorld
       t
       0.0.1-SNAPSHOT
       jar
    
       t
       http://maven.apache.org
    
       
        UTF-8
    
    
    
    
         /home/gede/bin/chromedriver
    
         
    
         
         
            
                src/main/java/resources
                true 
            
          
          
    
          
          maven-surefire-plugin
          2.7.1
           
            
                ${webdriver.chrome}
           
            
          
           
    
    
          
            org.apache.maven.plugins
            maven-surefire-plugin
            2.20
            
              
                testng.xml
              
            
            
    
          
    
    
           
           
    
           
          junit
          junit
          3.8.1
          test
          
    
          
         
        org.seleniumhq.selenium
        selenium-chrome-driver
        3.8.1
        
    
    
    
           
            org.seleniumhq.selenium
            selenium-java
            3.4.0
            
          
         org.testng
         testng
          6.8
         test
         
    
            
                org.seleniumhq.selenium   
                selenium-chrome-driver   
                3.8.1   
               
    
            
           io.github.bonigarcia
           webdrivermanager
          2.1.0
          
    
    
    
          
          com.relevantcodes
          extentreports
         2.41.2
         
    
    
    
          
          org.apache.logging.log4j
          log4j-api
          2.8.2
          
          
          org.apache.logging.log4j
          log4j-core
          2.8.2
          
         
    
    
    
     Selenuim Code 
    
    public class App 
    {
    static String currentDir = System.getProperty("user.dir");
    static WebDriver driver;
    
       @BeforeClass
        public static void setupClass() {
            ChromeDriverManager.getInstance().setup();
            driver= new ChromeDriver();
            driver.get("https://www.google.com/");
        }
    
    
    @Test
        public void test() {
    
    
    
    
    
        System.out.println( "Hello World!" );
    
        }
      }
    

提交回复
热议问题