Unable to create a java selenium project

I am unable to create a java selenium project. The packages are installed but on import statements gives error. I don’t see packages being listed in target/dependency and on unpacking it doesn’t work. Can someone please help?

Welcome to Ask @akanshanitr!

Could you please send your repl link or the error?

Here’s the link to my project:
https://replit.com/@akanshanitr/SeleniumJavaExample
Entire code is in it of what I am trying to do. Please let me know if it could be fixed, I fail to understand the error.

1 Like

Hello @akanshanitr!

On line eight:

import org.openqa.selenium.WebDriver;g

Try removing the g after the semicolon on line 8.


Once you do the above steps, you will see an error that you need to install Selenium WebDriver. You can try using this tutorial for guidence.

4 Likes

@Fairies0feast I don’t think that’s the right solution. I have installed the packages and then imported it in my code but on execution, I see that it says unable to import packages “package org.openqa.selenium does not exist” , I also see when I do mvn list- repositories, I see package name listed there. IT doesn’t make sense to me why selenium package is not getting imported into the code.

Hello @akanshanitr!

Try installing selenium again.