Skip to content

Instantly share code, notes, and snippets.

Using fswatch, brew install fswatch, found the cookies were being stored in /Users/Dave/Library/Application Support/SlimerJS/Profiles. From there, it looks like there is a database that the cookies are being added to. Also, the phantom.addCookie pref didn't work for me, in Wraith we set in JS to use page, so it is page.addCookie. That allows me to set cookies and run slimer, here is the cookie profile I setup in slimer https://dl.dropboxusercontent.com/u/39286148/t94z4zlt.wraith.zip

If you unzip that on your machine, then run it, see if the cookie pref remains and doesn't load on responsive. Not sure of the dir for linux, but if this works, it should work once we find that location.

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.6" jmeter="2.11 r1554548">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
#Headless browser option
browser:
webkit: "phantomjs"
# gecko: "slimerjs"
#If you want to have multiple snapping files, set the file name here
snap_file: "javascript/news.js"
# Type the name of the directory that shots will be stored in
directory:
source 'https://rubygems.org'
gem 'wraith', :git => 'git://github.com/DaveBlooman/wraith.git'
#Headless browser option
browser:
webkit: "phantomjs"
#If you want to have multiple snapping files, set the file name here
snap_file: "javascript/snap.js"
# Type the name of the directory that shots will be stored in
directory:
- 'shots'

Building PhantomJS. Please wait...

System architecture... (Darwin 13.3.0 x86_64)

~/Desktop/phantomjs-qt5/src/qt/qtbase ~/Desktop/phantomjs-qt5/src/qt

This is the Qt Open Source Edition.

You are licensed to use this software under the terms of

[
{
"browser": "firefox",
"browser_version": "27.0",
"device": null,
"os": "Windows",
"os_version": "7"
},
{
"browser": "chrome",
#!/bin/bash
if [[ "$1" == "stop" ]]
then
echo "Stopping browserstack tunnel..."
killall BrowserStackLocal
exit
fi
if [[ ! -e browserstack ]]

Devices

iPhone
GT-I9300
SAMSUNG GT-I9505
HTC One
Lumia 520
iPad
GT-I9100
GT-I9505
Lumia 920

Edit save_images.rb with

def capture_page_image(browser, url, width, file_name)
  width, height = width.split('x')
  puts `"#{browser}" #{@config['phantomjs_options']} "#{snap_file}" "#{url}" "#{width}" "#{file_name}" "#{height}"`
end

Edit snap.js with