Has anyone tried using browser mob proxy with iOS Safari?
Below is my code , but it doesn’t generate any HAR File. So I doubt if traffic is being routed through proxy.
If I manuall set the browserMob proxy on device, it works
//Create new proxy server
mobProxyServer = new ProxyServer(9901);
mobProxyServer.start();
//Create Selenium Proxy Object
Proxy proxy = mobProxyServer.seleniumProxy();
//Set Capabilities
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability(CapabilityType.PROXY,proxy);
desiredCapabilities.setCapability("platformName", "iOS");
desiredCapabilities.setCapability("platform-version", "7.0");
desiredCapabilities.setCapability("browserName","safari");
desiredCapabilities.setCapability("deviceName","iPhone 5s");
//Create Driver
//AppiumDriver driver = new AppiumDriver(new URL("http://0.0.0.0:4723/wd/hub"),desiredCapabilities);
driver = new RemoteWebDriver(new URL("http://0.0.0.0:4723/wd/hub"),desiredCapabilities);
//Create HAR File
mobProxyServer.newHar("test");
//Open website
driver.get("http://m.att.com");
Thread.sleep(10000);
//get and save HAR
Har har = mobProxyServer.getHar();
FileOutputStream fHarFile = new FileOutputStream("test.har");
har.writeTo(fHarFile);
I do automation using iOS Simulators on VMs. (VMWare Fusion) You need to set the OS X System Proxy in order for the emulator to use a proxy.
If you’re using a physical device, I’m not sure I can help.
When setting the system proxy, make sure to add the IP of your Selenium Grid and of the host running BMProxy to the proxy bypass settings, or Appium will try to connect to the grid via the proxy.
We haven’t looked into it in a while, but we have to use a set of static proxy port mappings (instead of on-the-fly) because the proxy Capability doesn’t seem to work in the scenario we use.
Granted, the initial research and implementation was done about a year ago using Appium 1.0, so if this has changed, that would be awesome.
I am able to get the HAR entries for Firefox but no luck with simulator or device(getting HAR with no entries in the file).
Is there anyway to setup browsermob proxy on my device ? Please help.
I was able to do it with both Android Emulators/Real device and also with iOS simulators/real device. We did it with Appium 1.0. I will try again doing this with latest Appium version 1.3.7 and share my findings soon.
What settings do i need to change in device for browsermob proxy to work on a real device. I am using Appium 1.5.3 and trying to run my tests on iPhone 10.x version.