I created a new file “test.rb”: #!/usr/bin/env ruby # includes require 'selenium-webdriver' # create new chrome webdriver driver = Selenium :: WebDriver. Now you’re ready to write some ruby code. # copy chromedriver into $PATH $ sudo cp chromedriver /usr/bin/ # download chromedriver # url: # chromedriver_mac_.0.zipĜhromeDriver server for mac # example: $ curl -O Applications/Google Chrome.app/Contents/MacOS/Google Chrome: Mach-O executable i386 # ensure Google Chrome is installed in the correct location $ file /Applications/Google \ Chrome.app/Contents/MacOS/Google \ Chrome # install selenium-webdriver gem $ gem install selenium-webdriver # create add a new gemset (optional) $ echo "rvm use -create >. # create a new project space $ mkdir selenium_testing In this tutorial I’ll show how to use the Selenium webdriver with Chrome and Ruby code to execute automated website tests and take screenshots along the way. Automated browser testing with screenshots on Mac OSX using Ruby and Selenium
0 Comments
Leave a Reply. |