Project

General

Profile

Revision 8ebd16d6

ID8ebd16d678e5dd3603513001d13be6e4e42204c8
Parent 763b610c
Child 761340e4

Added by Andreas Kohlbecker about 5 years ago

fixing selenium support for chrome browser

View differences:

src/main/java/eu/etaxonomy/dataportal/selenium/WebDriverFactory.java
4 4
package eu.etaxonomy.dataportal.selenium;
5 5

  
6 6
import java.io.IOException;
7
import java.util.concurrent.TimeUnit;
8 7

  
9 8
import org.apache.log4j.Logger;
10 9
import org.openqa.selenium.WebDriver;
11 10
import org.openqa.selenium.chrome.ChromeDriver;
12
import org.openqa.selenium.firefox.FirefoxBinary;
11
import org.openqa.selenium.chrome.ChromeOptions;
13 12
import org.openqa.selenium.firefox.FirefoxDriver;
14 13
import org.openqa.selenium.firefox.FirefoxProfile;
15 14
import org.openqa.selenium.ie.InternetExplorerDriver;
16 15

  
17 16
import eu.etaxonomy.dataportal.Browser;
18
import eu.etaxonomy.dataportal.DataPortalContext;
19 17
import eu.etaxonomy.dataportal.SystemUtils;
20 18
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
21 19

  
......
70 68

  
71 69

  
72 70
    private static WebDriver initChromeDriver() {
73
        return new ChromeDriver();
71

  
72
        ChromeOptions options = new ChromeOptions();
73

  
74
        String chromeBinary = System.getProperty("webdriver.chrome.bin");
75
        if(chromeBinary != null) {
76
            CdmDataPortalTestBase.logger.info(("webdriver.chrome.bin = " + chromeBinary));
77
            options.setBinary(chromeBinary);
78

  
79
        }
80
        return new ChromeDriver(options);
74 81
    }
75 82

  
76 83
    private static WebDriver initInternetExplorerDriver() {
src/main/resources/eu/etaxonomy/dataportal/DataPortalTest.xml
38 38

  
39 39
  -->
40 40
  <!-- <entry key="webdriver.firefox.bin"></entry> -->
41
  <!-- <entry key="webdriver.chrome.bin"></entry> -->
41
<!-- 
42
      NOTE: install the chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads 
43
   -->
44
  <!-- <entry key="webdriver.chrome.driver">/opt/chromedriver/chromedriver</entry> -->
45
  <!-- 
46
      Use this setting if the chrome browser is not found automatically 
47
   -->
48
  <!-- <entry key="webdriver.chrome.bin">/path/to/my/chromium-browser</entry> -->
49
  <!-- <entry key="webdriver.gecko.driver"></entry> -->
42 50
  <!--
43 51
    The browser to be used for testing (defaults to firefox)
44 52
  -->

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)