Giter VIP home page Giter VIP logo

Comments (6)

Ardesco avatar Ardesco commented on June 24, 2024

You can use the following repository as an example:

https://github.com/Ardesco/Selenium-Maven-Template

Specifically this part for setting system properties for your tests using the maven variables in the POM file:

https://github.com/Ardesco/Selenium-Maven-Template/blob/master/pom.xml#L182

from driver-binary-downloader-maven-plugin.

Ben-Mark avatar Ben-Mark commented on June 24, 2024
<plugin>
				<groupId>com.lazerycode.selenium</groupId>
				<artifactId>driver-binary-downloader-maven-plugin</artifactId>
				<version>1.0.16</version>
				<configuration>
					<rootStandaloneServerDirectory>${project.basedir}/src/test/resources/selenium_standalone_binaries</rootStandaloneServerDirectory>
					<downloadedZipFileDirectory>${project.basedir}/src/test/resources/selenium_standalone_zips</downloadedZipFileDirectory>
					<customRepositoryMap>${project.basedir}/src/main/resources/webdriver/RepositoryMap.xml</customRepositoryMap>
					<overwriteFilesThatExist>false</overwriteFilesThatExist>
					<onlyGetDriversForHostOperatingSystem>false</onlyGetDriversForHostOperatingSystem>
					<fileDownloadRetryAttempts>4</fileDownloadRetryAttempts>
					<fileDownloadReadTimeout>30000</fileDownloadReadTimeout>
					<useSystemProxy>true</useSystemProxy>
					<operatingSystems>
						<windows>true</windows>
						<linux>true</linux>
						<mac>false</mac>
					</operatingSystems>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>selenium</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>2.20.1</version>
				<configuration>
					<parallel>methods</parallel>
					<threadCount>1</threadCount>
					<systemPropertyVariables>
						<browser>firefox</browser>
						<screenshotDirectory>${project.build.directory}/screenshots</screenshotDirectory>
						<remoteDriver>false</remoteDriver>
						
						<proxyEnabled>false</proxyEnabled>

						<!--Set properties passed in by the driver binary downloader -->
						<webdriver.chrome.driver>${webdriver.chrome.driver}</webdriver.chrome.driver>
						<webdriver.ie.driver>${webdriver.ie.driver}</webdriver.ie.driver>
						<webdriver.gecko.driver>${webdriver.gecko.driver}</webdriver.gecko.driver>
						<webdriver.edge.driver>${webdriver.edge.driver}</webdriver.edge.driver>
					</systemPropertyVariables>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<!--This goal makes the build fail if you have test failures -->
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>
			</plugin>




and the repositoryMap.xml


<root>
    <windows>
        <driver id="internetexplorer">
            <version id="3.7.0">
                <bitrate sixtyfourbit="true">
                    <filelocation>http://selenium-release.storage.googleapis.com/3.7/IEDriverServer_x64_3.7.0.zip</filelocation>
                    <hash>f6a0d7939355acba00f7b1374bebda50bbead59b</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate thirtytwobit="true">
                    <filelocation>http://selenium-release.storage.googleapis.com/3.7/IEDriverServer_Win32_3.7.0.zip</filelocation>
                    <hash>ded0a82cab46538751ba17206f55c112674585d6</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="edge">
            <version id="5.16299">
                <bitrate sixtyfourbit="true" thirtytwobit="true">
                    <filelocation>https://download.microsoft.com/download/D/4/1/D417998A-58EE-4EFE-A7CC-39EF9E020768/MicrosoftWebDriver.exe</filelocation>
                    <hash>60c4b6d859ee868ba5aa29c1e5bfa892358e3f96</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="googlechrome">
            <version id="2.33">
                <bitrate thirtytwobit="true" sixtyfourbit="true">
                    <filelocation>https://chromedriver.storage.googleapis.com/2.33/chromedriver_win32.zip</filelocation>
                    <hash>b52ca785707eade99c56309ce9d66c1177b5d4a9</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="marionette">
            <version id="0.19.1">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-win64.zip</filelocation>
                    <hash>1d6a7ade773f98b3b5a15ace3b6a06b1ad97a8f1</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate thirtytwobit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-win32.zip</filelocation>
                    <hash>74258f5c73a8fce66fbc3ecd622dae890f1e475a</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
    </windows>
    <linux>
        <driver id="googlechrome">
            <version id="2.33">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://chromedriver.storage.googleapis.com/2.33/chromedriver_linux64.zip</filelocation>
                    <hash>717d67ab192b1c57819528161557ce2b66b9436c</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate thirtytwobit="true">
                    <filelocation>https://chromedriver.storage.googleapis.com/2.33/chromedriver_linux32.zip</filelocation>
                    <hash>cca39f74c1ddd2f2d7afd36f41a9f0db7be88dcf</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>


        <driver id="marionette">
            <version id="0.19.1">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-linux64.tar.gz</filelocation>
                    <hash>9284c82e1a6814ea2a63841cd532d69b87eb0d6e</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate thirtytwobit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-linux32.tar.gz</filelocation>
                    <hash>9375768a70365d361029f050d73e03aba0ece351</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate arm="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-arm7hf.tar.gz</filelocation>
                    <hash>115ad6e36c03445fed1499112156472eaa5faa1d</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
    </linux>
    
    <osx>
        <driver id="googlechrome">
            <version id="2.33">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://chromedriver.storage.googleapis.com/2.33/chromedriver_mac64.zip</filelocation>
                    <hash>eb28e6d716b04bfede98fbb74bae041d6a415aea</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="marionette">
            <version id="0.19.1">
                <bitrate thirtytwobit="true" sixtyfourbit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-macos.tar.gz</filelocation>
                    <hash>ae350f4510bbc0a8526f3fbfced8065b1b8586b2</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
    </osx>
</root>






from driver-binary-downloader-maven-plugin.

Ben-Mark avatar Ben-Mark commented on June 24, 2024

I've tried the maven-exec-plugin to catch those maven properties of the webdriver paths and failed
failsafe also failed

nothing would let me grab the System.getProperty("webdriver.chrome.driver");
or System.getenv("webdriver.chrome.driver");

Thought it might be auto set during maven build... nope...

Thanks in advance,
Ben

from driver-binary-downloader-maven-plugin.

Ardesco avatar Ardesco commented on June 24, 2024

What is the name of your test file?

Is it in the format myTestIT?

from driver-binary-downloader-maven-plugin.

Ardesco avatar Ardesco commented on June 24, 2024

Thought it might be auto set during maven build... nope...

The plugin set a maven variable as part of the build. You can then use this maven variable to set a system property in the test JVM created by maven surefire/failsafe (or whatever other test runner you are using).

Maven does not provide the ability for processes running in different phases to share system properties, you can only share maven variables.

from driver-binary-downloader-maven-plugin.

Ardesco avatar Ardesco commented on June 24, 2024

Closing this down as it's been inactive for ages

from driver-binary-downloader-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.