TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
John Riker
NA
85
15.8k
Server and Client invalid?
Nov 28 2020 10:18 AM
I am trying to figure out how to use Browsermob, Selenium 4 and get the HAR for a URL programatically. Not sure if anyone can share current way to do this, but all the references I find do not seem to compile. Like:
// Supply the path to the Browsermob Proxy batch file
Server server =
new
Server(@
"C:\temp\browsermob-proxy-2.1.4\bin\BrowserMobProxybinbrowsermob-proxy.bat"
);
server.Start();
Thread.Sleep(1000);
Client client = server.CreateProxy();
client.NewHar(
"assertselenium"
);
var chromeOptions =
new
ChromeOptions();
var seleniumProxy =
new
Proxy { HttpProxy = client.SeleniumProxy, SslProxy = client.SeleniumProxy };
chromeOptions.Proxy = seleniumProxy;
var dr =
new
ChromeDriver(chromeOptions);
dr.Navigate().GoToUrl(
"http://www.google.com"
);
dr.FindElementByClassName(
"gb_e"
).Click();
Thread.Sleep(3500);
dr.Navigate().Refresh();
// Get the performance stats
HarResult harData = client.GetHar();
Log log = harData.Log;
Entry[] entries = log.Entries;
foreach
(var e
in
entries)
{
Request request = e.Request;
Response response = e.Response;
var url = request.Url;
var time = e.Time;
var status = response.Status;
var testStr =
"Url: "
+ url +
" - Time: "
+ time +
" Response: "
+ status;
}
dr.Quit();
client.Close();
server.Stop();
The Server and Client errors that the Namespace could not be found. Tried a number of paths but things like server.Stop() aren't found even if I can find an assembly just to get server.Start() to "look" OK. Though still think it's the wrong assembly.
Get the same for just HarResult, Log, Entry. Log and Entry I in theory can get to show OK with Grpc but not sure that's really the right reference to use.
Thoughts?
Reply
Answers (
2
)
how do we design database in cosmos db?
Decrypt password from database.