browsermob-cli 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34f2f761077d90c5ab4d73320d6722ce1362073b
4
- data.tar.gz: 2c71f18b9826d9ca584433570ded7a18f4b25ace
3
+ metadata.gz: adfc28fbfcdd6caa72ea973d330426f611ac09bd
4
+ data.tar.gz: a7591fb8cc870c3b37bd4e381dac73959d0dc90c
5
5
  SHA512:
6
- metadata.gz: 5f1b2c97e42092be8842a290aa26ec6d7d0264d01e9fbd6532a73c67c0ffcfa7c044198d0c65e6e872b51a3aa1fe0d31d4a7d49b8c9ab18b5332e1a4d0f2a3e6
7
- data.tar.gz: 761ee53a73117e6309c111fecca05862b5e964dd39888b959173dde6393d8a237b0f431ce67e2608d4606122bb4eddbc3c372e54ffb788a51e8a8c837f77909a
6
+ metadata.gz: 301edd6f17ff2f7c35b895d5ffb0c5e70d54eaea40edeceda722b382f495227cb7dd44be6eca576da76987f58f63fdab391072ae79fd61b955adffdae3c897bf
7
+ data.tar.gz: 46c8ddf64745c210ca973c54d383bf2461018818348ac6b84cace436617941c5715e5b05a4868d15829b641b7463a4d31af24b39246423207dd488935dc14526
data/README.md CHANGED
@@ -1,8 +1,20 @@
1
1
  # BrowserMob CLI
2
2
 
3
- BrowserMob CLI os Rubygem to generate HAR files from command line. This will preview HAR files in the Browser as well as parse it in YAML. It works well for FirefoxDriver and ChromeDriver/GhostDriver are WIP
3
+ BrowserMob CLI os Rubygem to generate HAR files from command line. This will preview HAR files in the Browser as well as parse it in YAML. It works well for FirefoxDriver and ChromeDriver/GhostDriver are WIP.
4
4
 
5
- BrowserMob CLI can do following things:
5
+ If you are new to HAR(HTTP Archive) & BrowserMob Proxy then please read these couple of links
6
+ * What is [HAR](https://www.maxcdn.com/one/visual-glossary/har-file/)
7
+ * HAR [Spec](http://www.softwareishard.com/blog/har-12-spec/)
8
+ * [BrowserMobProxy](http://bmp.lightbody.net/)
9
+
10
+ HAR file can be used for
11
+ * Calculate Load time.
12
+ * Set/Get HTTP Headers during your tests
13
+ * Capture performance data with HAR files.
14
+ * Simulate network traffic and latency
15
+ * Rewrite HTTP requests and response
16
+
17
+ ##BrowserMob CLI can do following things:
6
18
 
7
19
  * Download Browsermobproxy programatically and save it in /tmp
8
20
 
@@ -18,6 +30,10 @@ BrowserMob CLI can do following things:
18
30
  Before we start, please make sure you got following packages installed
19
31
 
20
32
  * wget
33
+ * Java version > 1.7 and JAVA_HOME set in .bashrc or .zshrc. This is important otherwise browsermob proxy server won't start. OSX Mac user can set it using
34
+
35
+ export JAVA_HOME=$(/usr/libexec/java_home)
36
+
21
37
  * Ruby > 1.9.3
22
38
  * Bundler
23
39
  * Install Har gem
@@ -41,11 +57,14 @@ Or install it yourself as:
41
57
  ## Usage
42
58
 
43
59
  #### Download BrowserMob Proxy
44
- Assuming that you don't have BrowserMob Proxy downloaded, then first thing we probaly need to download it and save it to your /tmp directory (Assuming /tmp has write access). It should do be done by
60
+ Assuming that you don't have BrowserMob Proxy downloaded, then first thing we probaly need to download it and save it to your /tmp directory (Assuming /tmp has write access). Just run following command.
45
61
 
46
62
  $ browsermob-cli setup
47
63
 
48
- Now, you should have browsermob-proxy binary downloaded. We need to keep in the /tmp directory itself.
64
+ Now, you should have browsermob-proxy binary downloaded in the /tmp directory itself.
65
+
66
+ If that does't work, feel free to manually download BrowserMob proxy from [official website](https://bmp.lightbody.net/) Or from Github.
67
+ Save it to /tmp/browsermob-proxy
49
68
 
50
69
  #### Generate HAR file for any URL
51
70
  We can generate HAR data for any url e.g (AOL website) by running
@@ -90,3 +109,22 @@ You can view generated YAML file with HAR data.
90
109
  browsermob-cli version # Get the current version number
91
110
  browsermob-cli view_har_in_YAML # Display HAR file in YML in your Editor
92
111
  browsermob-cli view_har_in_browser # Open up browser and Preview HAR file. Press Ctl+C Once DONE...
112
+
113
+ ### Common issues
114
+
115
+ * Server won't start
116
+ Issue: Error message
117
+
118
+ unable to launch the server (rerun with :log => true to see process output) (BrowserMob::Proxy::Server::ServerDiedError)
119
+
120
+ There may be few reason.
121
+
122
+ 1] It uses port 7676. It may be in use. Clear the port by running following command
123
+
124
+ $ kill -9 $(lsof -i tcp:3000 -t)
125
+
126
+ It works for Mac OSX.
127
+
128
+ 2] Java version is below 1.7. Update your JAVA version.
129
+
130
+ 3] Make sure $JAVA_HOME set correctly, for mac, it’s “export JAVA_HOME=$(/usr/libexec/java_home)”.
@@ -20,9 +20,9 @@ module BrowserMob
20
20
 
21
21
  def download_browsermob_proxy
22
22
  FileUtils.rm_rf('/tmp/browsermob-proxy') if Dir.exists?("/tmp/browsermob-proxy")
23
- system('cd /tmp && wget https://github.com/downloads/webmetrics/browsermob-proxy/browsermob-proxy-2.0-beta-6-bin.zip')
24
- system("cd /tmp && unzip browsermob-proxy-2.0-beta-6-bin.zip")
25
- system("mv /tmp/browsermob-proxy-2.0-beta-6 /tmp/browsermob-proxy/")
23
+ system('cd /tmp && wget https://github.com/lightbody/browsermob-proxy/releases/download/browsermob-proxy-2.1.0-beta-4/browsermob-proxy-2.1.0-beta-4-bin.zip')
24
+ system("cd /tmp && unzip browsermob-proxy-2.1.0-beta-4-bin.zip")
25
+ system("mv /tmp/browsermob-proxy-2.1.0-beta-4 /tmp/browsermob-proxy/")
26
26
  system("chmod +x /tmp/browsermob-proxy/bin/browsermob-proxy")
27
27
  end
28
28
 
@@ -45,6 +45,11 @@ module BrowserMob
45
45
  def view_har_in_YAML
46
46
  system("open /tmp/traffic.yml")
47
47
  end
48
+
49
+ desc 'kill_port', 'Clear Port used by BrowserMob proxy'
50
+ def port_clearance
51
+ system('kill -9 $(lsof -i tcp:7676 -t)')
52
+ end
48
53
  end
49
54
  end
50
55
  end
@@ -1,5 +1,5 @@
1
1
  module BrowserMob
2
2
  module CLI
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browsermob-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shashikant86
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-01 00:00:00.000000000 Z
11
+ date: 2016-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor