Download Selenium 2.53.1 and extrat it.
Download Firefox Geckodriver v0.15.0 and extrat it.
Set Firefox Webdriver Path
export PATH=$PATH:/home/firefox-driver/geckodriver
Download Google Chrome Browser Install Package
Open Terminal
Type "dpkg -i google-chrome-stable_current_amd64.deb" to install.
nano opt/google/chrome/google-chrome
Modify exec -a "$0" "$HERE/chrome" "$@" to exec -a "$0" "$HERE/chrome" "$@" --user-data-dir --no-sandbox
save and exit
Download Google Chromedriver 2.28 and extrat it.
Install JDK8
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java8-installer -y
Open Firefox web browser and install Selenium IDE Add-on.
Record your test case html file and put it with /home/selenium/selenium-server.jar
Run Selenium with firefox:
java -jar /home/selenium/selenium-server.jar -htmlSuite *firefox http://example.com "/home/testcase/Suite.html" "/home/report/firefox-results.html"
Run Selenium with chrome:
java -jar -Dwebdriver.chrome.driver=/home/chrome-driver/chromedriver /home/selenium/selenium-server.jar -trustAllSSLCertificates -htmlSuite *googlechrome http://example.com "/home/testcase/Suite.html" "/home/report/chrome-results.html"
沒有留言:
張貼留言