Skip to content

Commit

Permalink
Generating har file
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Feb 27, 2024
1 parent 28395d4 commit cb9982b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions selenium-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
</license>
</licenses>

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<properties>
<surefire.parallel>10</surefire.parallel>
<maven.compiler.source>11</maven.compiler.source>
Expand Down Expand Up @@ -51,6 +58,11 @@
<version>2.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.blibli-badak</groupId>
<artifactId>selenium-har-util</artifactId>
<version>1.0.9</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import com.google.common.collect.ImmutableMap;
import com.google.common.net.MediaType;

import com.blibli.oss.qa.util.services.NetworkListener;
import com.saucedemo.selenium.TestBase;

import java.io.IOException;
Expand Down Expand Up @@ -405,4 +407,13 @@ void replacingResponse() {
Assertions.assertEquals(1, addedItem.size());
}
}

@Test
void createHarFile() {
NetworkListener networkListener = new NetworkListener(driver, "har.har");
networkListener.start();
driver.get("https://saucelabs.com");
networkListener.createHarFile();
}

}

0 comments on commit cb9982b

Please sign in to comment.