Setup Playwright Java maven project in Eclipse

Tutorial 1 – Playwright​​ Java​​ setup​​ in Eclipse IDE

What you will Learn:

  • Create​​ Java maven​​ Playwright​​ project in eclipse

  • Add​​ Junit​​ jupiter​​ maven dependency

  • Add​​ Junit​​ jupiter params​​ maven dependency

  • Add​​ Playwright​​ maven dependency

  • Configure JavaSE-1.8​​ in Eclipse

Create​​ Java maven​​ Playwright​​ project in eclipse

Refer​​ below​​ blog​​ link​​ to create a new maven project

https://www.way2automation.com/getting-started-with-selenium-4-0-and-adding-dependencies/​​ 

Add​​ Junit​​ jupiter’ maven dependency

Go to the mvn repository and search for ‘junit jupiter’ ​​ https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api/5.9.0​​ 

Copy the above dependency​​ and paste it in dependencies section of pom.xml file

Save xml​​ to​​ automatically download all the​​ Junit​​ dependencies.

Once the save process completes,​​ expand​​ ‘Maven Dependencies’ folder to see the added jars

Add​​ Junit​​ jupiter params​​ maven​​ dependency

Similarly add ‘Junit Jupiter Params’ dependency

See below

Save the file.

Add​​ Playwright maven dependency

Search for Playwright

Add dependency and save the file.​​ 

On​​ the left hand side,​​ the playwright​​ jars can be seen

Configure JavaSE-1.8​​ in Eclipse

Note:​​ If you do not perform​​ the below​​ steps, you might get an error:​​ ‘References to interface static methods are allowed only at source level 1.8 or above.

Right click​​ maven​​ project > properties > java build path > libraries > select ‘JRE System Library’ > Edit > select ‘JavaSE-1.8 (jre1.8.0)’ > Finish > Apply and close > you should see ‘JRE System Library [JavaSE-1.8]’

 ​​​​ 

We are done with the basic​​ maven project​​ setup.​​ 

In our next blog, we will create our first PW-java​​ test.

Thank you for reading!

Share On

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp
Share on tumblr
Share on email

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top

Lifetime Membership Club

LIFETIME MEMBERSHIP BIG SALE - ALL LIVE COURES JUST - 7000 RS/ 99 USD
Attend All Live courses in just 7000 rs / $99 - offer ends 31st DEC 2024