browsermob

Selenium get .har file

与世无争的帅哥 提交于 2019-11-27 15:46:15
I have a two page application: /login /profile I want to get .har file page /profile . When i go to the page /login , the cookie is created with a key=connect.sid and value = "example value". This cookie is not yet active. I added the cookies with active connect.sid. WebDriver webDriver = getDriver(); webDriver.get(LOGIN_PAGE); webDriver.manage().addCookie(connectsSId); it does not work because after the load page, /login crated a new cookies. i also tried this code: WebDriver webDriver = getDriver(); webDriver.get(PROFILE_PAGE); webDriver.manage().deleteAllCookies(); webDriver.manage()

Setting a custom header using BrowserMob-Proxy REST api

时间秒杀一切 提交于 2019-11-27 07:15:01
问题 I have a browsermob proxy running on port 9091. I am trying to use browsermob-proxy REST API to set a custom header. When I make a request to my app using Selenium via the proxy, I don't see the header printed in my apps console. Below is my code. The request body is based on documentation here. My requirement is to use BrowserMob proxy API and not its Java library for this particular use case. Anything I am doing wrong in the code below? Proxy proxy = new java.net.Proxy(java.net.Proxy.Type

Selenium get .har file

大憨熊 提交于 2019-11-26 17:18:51
问题 I have a two page application: /login /profile I want to get .har file page /profile . When i go to the page /login , the cookie is created with a key=connect.sid and value = "example value". This cookie is not yet active. I added the cookies with active connect.sid. WebDriver webDriver = getDriver(); webDriver.get(LOGIN_PAGE); webDriver.manage().addCookie(connectsSId); it does not work because after the load page, /login crated a new cookies. i also tried this code: WebDriver webDriver =