selenium 2 chrome driver

后端 未结 10 594
情书的邮戳
情书的邮戳 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:31

    You could have a go at using the driver binary downloader maven plugin to download the driver binaries for you (https://github.com/Ardesco/selenium-standalone-server-plugin):

                    
                        com.lazerycode.selenium
                        driver-binary-downloader-maven-plugin
                        1.0.7
                        
                            ${project.basedir}/src/test/resources/selenium_standalone_binaries
                            ${project.basedir}/src/test/resources/selenium_standalone_zips                            
                        
                        
                            
                                
                                    selenium
                                
                            
                        
                    
    

    This will download the binaries and set a maven property that you can use in your surefire/failsafe configuration like this:

                    
                        org.apache.maven.plugins
                        maven-failsafe-plugin
                        2.7.2
                                                    
                                                          
                                
                                ${phantomjs.binary.path}
                                ${webdriver.chrome.driver}
                                ${webdriver.ie.driver}
                                ${webdriver.opera.driver}
                            
                            
                                **/*WebDriver.java
                            
                        
                        
                            
                                
                                    integration-test
                                    verify
                                
                            
                        
                    
    

    When you instantiate a new driver object the system property pointing to the driver binary location will now be set and it will just work.

提交回复
热议问题