0

I have setup a Windows Server 2012 instance on AWS and I am running Jenkins with a Selenium grid server. The build portion goes through fine, however it is failing with a 404 when it tries to call the browserMob.NET server.CreateProxy() call. I thought perhaps it was a security port issue, so I opened 9090 and 9091 but still having the same issue. If I use the IWebDriver on my local system, everything goes through fine, but when I change over to the remoteWebDriver and point it to the AWS server and try to proxy, I get an error. If anyone has any ideas about how I might be able to go about this, I'm ready for a kick in the right direction :) Thanks!

--Edit: Some more info: I now have Jenkins running on 8081 and now it stops with a InvalidOperationException. On the same call of server.CreateProxy() the error fired says:

"The specified domain either does not exist or could not be contacted"

Ports currently opened in IIS8 are 80, 9090, 9091, and 8080

I also downloaded the the project to the server and tried to run it from the server and I am seeing the same thing. I also am still running IWebDriver and it doesn't work. So if I run this locally on my personal Win 7 Box, it works fine, but when I run it from Windows Server 2012, it does not. This is the same project, but I have no clue as to what may be going on here.

try
{
Server server = new Server(pathToBrowserMobProxy);
server.Start();

Client client = server.CreateProxy();
client.NewHar("google");

var seleniumProxy = new Proxy { HttpProxy = client.SeleniumProxy };
var capabilities = DesiredCapabilities.Firefox();
capabilities.SetCapability(CapabilityType.Proxy, seleniumProxy);

var driver = new RemoteWebDriver(new Uri(seleniumServerUrl), capabilities);
driver.Navigate().GoToUrl("http://www.google.co.uk");

HarResult harData = client.GetHar();

driver.Quit();
client.Close();
server.Stop();

return Newtonsoft.Json.JsonConvert.SerializeObject(harData);
}
catch (Exception e) { throw e; }
xtr33me
  • 764
  • 1
  • 10
  • 30

1 Answers1

1

So I finally figured out what was going on and thought I'd post here. The call to server.CreateProxy was using the AutomatedTester.BrowserMob .NET wrapper. This internally had a reference to a version of Newtonsoft JSON.net that was compiled as 32bit. Because of this and my Server 2012 box being 64bit, it was causing an error stating "32 bit processes cannot access modules of a 64 bit process" when it would instantiate the "Process" object. It would open the command window and then crash which would close the window and it wouldnt eb able to find the instance to conenct to. In looking at the NativeErrorCode of 299, I found this was stating that only part of a ReadProcessMemory or WriteProcessMemory request was completed. So I got the src for AutomatedTester, removed the ref to newtonsoft they were using (since this was the first 32bit ref I had found) and added the Nuget version which is compiled for Any CPU. This stopped the crash and allowed me to run my tests. Hope this helps someone else one day.

xtr33me
  • 764
  • 1
  • 10
  • 30