Browsermod redirecting to localhost and random port only for internet explorer

451 views
Skip to first unread message

motorhead

unread,
Jul 17, 2013, 4:08:20 PM7/17/13
to browserm...@googlegroups.com
Hi,

I'm using browsermob to collect all the request headers. I'm testing it through firefox and internet explorer. However in internet explorer when I start the driver it redirects to localhost:xxxx regardless of what I do. Pls see my code below
                                ProxyServer server = new ProxyServer(8105);
        server.start();
        server.setCaptureHeaders(true);
File file = new File(driverPath);
Proxy proxy = server.seleniumProxy();
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities .setCapability("ignoreProtectedModeSettings", true); 
capabilities .setCapability("ignoreZoomSetting", true);
capabilities .setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
capabilities .setCapability(CapabilityType.PROXY, proxy);
driver = new InternetExplorerDriver(capabilities );      <------------------------------ When it comes here, it invokes the browser and goes to localhost:xxxx and throws the exception below
driver.get("http://www.google.com");
Har har = server.getHar();



INFO 07/17 20:05:07 n.l.b.p.j.h.HttpSer~ - Version Jetty/5.1.x
INFO 07/17 20:05:07 n.l.b.p.j.u.Contain~ - Started HttpContext[/,/]
INFO 07/17 20:05:07 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:8105
INFO 07/17 20:05:07 n.l.b.p.j.u.Contain~ - Started net.lightbody.bmp.proxy.jetty.jetty.Server@711a2c8f
INFO 07/17 20:05:22 o.o.s.b.WindowsProx~ - Modifying registry settings...
INFO 07/17 20:05:25 o.o.s.b.WindowsProx~ - Copying cookies from C:\Users\user1\AppData\Roaming\Microsoft\Windows\Cookies to C:\Users\user1\CookiesHiddenBySeleniumRC
INFO 07/17 20:05:25 o.o.s.b.WindowsProx~ - Deleting original cookies...
INFO 07/17 20:05:25 o.o.s.b.WindowsProx~ - looking for files ending with: .txt
Started InternetExplorerDriver server (32-bit)
2.33.0.0
Listening on port 15965


then in internet explorer I see it's trying to connect to http://localhost:15965/.

Nothing happens after that. Could some one pls help me. Thanks a lot!

motorhead

unread,
Jul 17, 2013, 5:03:19 PM7/17/13
to browserm...@googlegroups.com
To add more information...

After I stop loading the http://localhost:xxxx in the browser, next step which is driver.get() is loaded and it opens the URL that I have mentioned.

After that I'm just seeing the following

INFO 07/17 20:59:02 n.l.b.p.h.BrowserMo~ - EOFException(java.net.SocketException: Software caused connection abort: socket write error) when requesting http://xxxxxxx/com/dfdf/
WARN 07/17 20:59:02 n.l.b.p.j.h.HttpCon~ - Invalid length: Content-Length=41041 written=31328 for http://xxxxxxx/com/dfdf/
INFO 07/17 20:59:04 n.l.b.p.j.u.Credent~ - Checking Resource aliases
INFO 07/17 20:59:06 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:64080
WARN 07/17 20:59:23 n.l.b.p.ProxyServer  - Waited 5 seconds for requests to cease before returning HAR; giving up!

This is working fine in Chrome and firefox. Only in internet explorer I'm facing this problem

Patrick Lightbody

unread,
Jul 22, 2013, 1:44:08 AM7/22/13
to browserm...@googlegroups.com
I wish I could help but I don't have ready access to an IE browser. I see that masked the host that was being access in the logs, but your test case hits google.com. Is that test a real test that reproduces the problem, or do I need to use a different (private) URL?

Patrick

--
 
---
You received this message because you are subscribed to the Google Groups "BrowserMob Proxy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to browsermob-pro...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

motorhead

unread,
Jul 22, 2013, 12:53:24 PM7/22/13
to browserm...@googlegroups.com
Hello Patrick,

google .com is not the real URL. I'm using a private URL. The thing is it works fine for chrome and firefox. but for IE the hudsuckr writes it's own value in registry for "AutoConfigURL" string value

the value is "file://C:/Users/testuser1/AppData/Local/Temp/webdriver-ie5388624364831351548/proxy.pac"

So I think when the IR browser is started it's redirected to that proxy and that's causing all the issue. In case of Firefox and chrome browsermob started normally and accessed my company's proxy which worked perfectly fine. 

Could you pls help me on this Patrick?

Thanks!

Patrick Lightbody

unread,
Jul 22, 2013, 2:08:43 PM7/22/13
to browserm...@googlegroups.com
What are the contents of that file? This is really becoming a Selenium/IE issue more than a BMP issue, so my ability to help is pretty limited.

motorhead

unread,
Jul 22, 2013, 4:02:19 PM7/22/13
to browserm...@googlegroups.com
Patrick,

That file is setting it to "local host".

But now the new problem is firefox and chrome are not working as well. It's not even opening any websites if I start browser through browsermob. Because it set the proxy setting of a browser to my machine's name. I don't know what happened. It was working perfectly before. nothing changed

Julian

unread,
Sep 11, 2013, 2:09:03 PM9/11/13
to browserm...@googlegroups.com
motorhead, did you figure out what the problem was?

I'm having a very similar issue with IE (and sometimes FF & Chrome), and I'm using the Python bindings for Selenium & BMP.

motorhead

unread,
Oct 16, 2013, 5:26:49 PM10/16/13
to browserm...@googlegroups.com
Yes. I cleared the temporary folder and it fixed the issue
Reply all
Reply to author
Forward
0 new messages