kazurayam / selenium-webdriver-java

Examples of the O'Reilly book "Hands-On Selenium WebDriver with Java"
https://oreil.ly/1E7CX
Apache License 2.0
0 stars 0 forks source link

In IntelliJ IDEA; unable to compile `io.github.bonigarcia.webdriver.junit4.ch02.helloworld.HelloWordChromeJUnit4Test`; unable to resolve `org.junit.Test` #9

Closed kazurayam closed 10 months ago

kazurayam commented 10 months ago

As you can see in the following screenshot;

Screenshot 2023-10-21 at 17 06 42

Many import statements failed to refer to external classes.

However, I could compile the io.github.bonigarcia.webdriver.junit5.ch02.helloworld.HelloWordChromeJUnit5Test class.

I must have some mistake in the settings in my IntelliJ IDEA for the classpath.

kazurayam commented 10 months ago

In the project directory, I found .idea directory.

:~/github/selenium-webdriver-java (kazurayam8)
$ ls -la 
total 80
drwxr-xr-x   22 kazuakiurayama  staff    704 10 21 18:19 .
drwxr-xr-x  168 kazuakiurayama  staff   5376 10 20 17:07 ..
drwxr-xr-x   12 kazuakiurayama  staff    384 10 21 17:51 .git
drwxr-xr-x    4 kazuakiurayama  staff    128 10 20 09:20 .github
-rw-r--r--    1 kazuakiurayama  staff    115 10 20 09:20 .gitignore
drwxr-xr-x    9 kazuakiurayama  staff    288 10 20 19:35 .gradle
drwxr-xr-x    4 kazuakiurayama  staff    128 10 21 18:19 .idea
...

I deleted the .idea directory. I reopened this project in IntelliJ IDEA. IDEA automatically started loading all the Gradle projects.

I had to configure the Gradle JVM as I did at #2.

Then I could compile the classes under the selenium-webdriver-junit4 subproject.