I was having issues with running Selenium tests. I finally found a solution about adding an extra dependency and a line of code to be run before the tests as per https://stackoverflow.com/a/75722029/12865183
Dependency:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-http-jdk-client</artifactId>
<version>4.5.0</version>
</dependency>
Line of code:
System.setProperty("webdriver.http.factory", "jdk-http-client");
Finally my current testing setup looks like that:
public class seleniumTest {
WebDriver driver;
@BeforeEach
void setup(){
System.setProperty("webdriver.http.factory", "jdk-http-client");
driver = WebDriverManager.chromedriver().create();
}
@AfterEach
void teardown(){
driver.quit();
}
@Test
void test(){
}
}
I wanted to ask if there is a way to set the System property permanently? Meaning for the code not to need the System.setProperty bit each time it's run.
I found the idea.vmoptions and idea.properties files within my InteliJ package contents (Using MacOS BigSur) but I am not sure what syntax would I use to set up System properties there and if it's possible at all.