Skip to content

Instantly share code, notes, and snippets.

@seleniumgists
Created February 14, 2019 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seleniumgists/e0d74fba67b08eae3a4381661a024330 to your computer and use it in GitHub Desktop.
Save seleniumgists/e0d74fba67b08eae3a4381661a024330 to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
private static HarEntry getRequest(String href) {
if(!recallProxyUsed()) {
System.out.println("Proxy not recording, skipping fetch");
return null;
}
int retries = 0;
Har har = null;
while (retries < 30) {
sleep(100);
retries++;
har = getHar();
List<HarEntry> entries = har.getLog().getEntries();
for (HarEntry entry : entries) {
String url = entry.getRequest().getUrl();
if (url.contentEquals(href)) {
stopRecording();
return entry;
}
}
}
writeHarFile(har, "missing-request");
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment