Why do I get "Can't resolve character"?

I imported this project before, without any difficulty. I'm not sure what has changed.

I click Import Project and select getting-started-with-selenium ( http://github.com/ddavison/getting-started-with-selenium ), which is a Maven project, and the old Eclipse project. I clicked on the directory, then in “Library Selection” or something else, I chose Maven .

I changed my build path to fit correctly ...

 src/ main/ java/ <-- source folder. tests/ java/ <-- tests folder. 

Nevertheless, I get "Cannot resolve symbol 'After'" . Although in maven libraries I see it clearly. enter image description here

Let me know if there is any further information.

+6
source share
2 answers

Make sure that if JUnit is declared as <scope>test</scope> , your test class is in src/test , otherwise it will not be able to see the dependency.

+9
source

Make sure you can compile the project through Maven (i.e. via the command line) via mvn clean compile .

If this generates errors, make sure you have a junit dependency that is mostly included in the POM.

If this does not create errors, then IntelliJ does not know where the new libraries are.

To fix this, simply go to the Maven Projects tab in the main window and click the "Create Sources and Folder Updates for All Projects" button. Then click on "Reimport All Maven Projects", which is located next to the previous button.

+5
source

All Articles