Created
February 14, 2019 12:12
-
-
Save seleniumgists/e0d74fba67b08eae3a4381661a024330 to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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