{"id":2839,"date":"2025-01-14T12:20:13","date_gmt":"2025-01-14T12:20:13","guid":{"rendered":"https:\/\/rahulshettyacademy.com\/blog\/?p=2839"},"modified":"2025-01-17T10:22:54","modified_gmt":"2025-01-17T10:22:54","slug":"playwright-java-setup-in-eclipse-ide","status":"publish","type":"post","link":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2025\/01\/14\/playwright-java-setup-in-eclipse-ide\/","title":{"rendered":"Playwright Java setup in Eclipse IDE"},"content":{"rendered":"<\/p>\n<p>In this blog, you will learn how to create a Playwright Java project in the Eclipse IDE. You will also learn how to add the maven dependencies such as: Junit jupiter, Junit jupiter params, Junit playwright and JUnit Jupiter Engine. Additionally, you will configure JavaSE-1-1.8 and create a Java maven playwright project in eclipse.<\/p>\n<p><b>Topics that we will cover:<\/b><\/p>\n<ul>\n<li>Create maven Playwright project<\/li>\n<li>Add maven dependencies: \u2018JUnit Jupiter\u2019, \u2018JUnit Jupiter params\u2019, \u2018JUnit Jupiter Engine\u2019, \u2018Playwright\u2019<\/li>\n<li>Configure JavaSE-1.8<\/li>\n<\/ul>\n<p><b><u>Create maven Playwright project<\/u><\/b><\/p>\n<p>File &gt; New &gt; \u2018Maven Project\u2019<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"2998\" width=\"603\" data-init-width=\"460\" height=\"118\" data-init-height=\"90\" title=\"1\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/1.png\" data-width=\"603\" data-height=\"118\" style=\"aspect-ratio: auto 460 \/ 90;\"><\/span><\/p>\n<p>Select \u2018Create a simple project\u2019 option<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"2999\" width=\"428\" data-init-width=\"290\" height=\"189\" data-init-height=\"128\" title=\"2\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/2.png\" data-width=\"428\" data-height=\"189\" style=\"aspect-ratio: auto 290 \/ 128;\"><\/span><\/p>\n<p>Click Next, enter \u2018Group Id\u2019 and \u2018Artifact Id\u2019<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3000\" width=\"377\" data-init-width=\"231\" height=\"137\" data-init-height=\"84\" title=\"3\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/3.png\" data-width=\"377\" data-height=\"137\" style=\"aspect-ratio: auto 231 \/ 84;\"><\/span><\/p>\n<p>Click Finish.<\/p>\n<p>\u2018<b>M<\/b>\u2019 represents maven project<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3001\" width=\"388\" data-init-width=\"388\" height=\"138\" data-init-height=\"138\" title=\"4\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/4.png\" data-width=\"388\" data-height=\"138\" style=\"aspect-ratio: auto 388 \/ 138;\"><\/span><\/p>\n<p>Refresh the maven project to see the folder structure<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3002\" width=\"438\" data-init-width=\"223\" height=\"320\" data-init-height=\"163\" title=\"5\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/5.png\" data-width=\"438\" data-height=\"320\" style=\"aspect-ratio: auto 223 \/ 163;\"><\/span><\/p>\n<p><b>Add maven dependency for \u2018JUnit Jupiter\u2019<\/b><\/p>\n<p>The \u2018JUnit Jupiter\u2019 maven dependency can be found in the official maven site <a href=\"https:\/\/mvnrepository.com\/artifact\/org.junit.jupiter\/junit-jupiter-api\" style=\"outline: none;\" target=\"_blank\" rel=\"noopener\">https:\/\/mvnrepository.com\/artifact\/org.junit.jupiter\/junit-jupiter-api<\/a> &nbsp;&nbsp;<\/p>\n<p>This dependency is needed to write the JUnit tests<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3008\" width=\"404\" data-init-width=\"404\" height=\"547\" data-init-height=\"547\" title=\"6\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/6.png\" data-width=\"404\" data-height=\"547\" style=\"aspect-ratio: auto 404 \/ 547;\"><\/span><\/p>\n<p>Copy\/paste the above dependency in dependencies section of pom.xml<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3009\" width=\"974\" data-init-width=\"974\" height=\"482\" data-init-height=\"482\" title=\"7\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/7.png\" data-width=\"974\" data-height=\"482\" style=\"aspect-ratio: auto 974 \/ 482;\"><\/span><\/p>\n<p>Save xml. This will automatically download JUnit dependencies.\u2018Maven Dependencies\u2019 folder would now show the added junit jars<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3012\" width=\"1150\" data-init-width=\"1150\" height=\"438\" data-init-height=\"438\" title=\"1\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/1-1.png\" data-width=\"1150\" data-height=\"438\" style=\"aspect-ratio: auto 1150 \/ 438;\"><\/span><\/p>\n<p><b>Add maven dependency for \u2018JUnit Jupiter Params\u2019<\/b><\/p>\n<p>Similarly let us add \u2018JUnit Jupiter Params\u2019 dependency<\/p>\n<p><a href=\"https:\/\/mvnrepository.com\/search?q=Junit+Jupiter+Params\" style=\"outline: none;\" target=\"_blank\" rel=\"noopener\">https:\/\/mvnrepository.com\/search?q=Junit+Jupiter+Params<\/a><\/p>\n<p>This dependency is needed to run the parametrized tests<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3013\" width=\"1198\" data-init-width=\"1198\" height=\"1618\" data-init-height=\"1618\" title=\"2\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/2-1.png\" data-width=\"1198\" data-height=\"1618\" style=\"aspect-ratio: auto 1198 \/ 1618;\"><\/span><\/p>\n<p>Save xml<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3014\" width=\"1198\" data-init-width=\"1198\" height=\"442\" data-init-height=\"442\" title=\"Screenshot 2025-01-14 at 7.01.23\u202fPM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-14-at-7.01.23\u202fPM.png\" data-width=\"1198\" data-height=\"442\" style=\"aspect-ratio: auto 1198 \/ 442;\"><\/span><\/p>\n<p><b><u>Add <\/u><\/b><b>maven dependency for \u2018Playwright\u2019<\/b><\/p>\n<p>Similarly let us add playwright dependency<b> <\/b><\/p>\n<p><a href=\"https:\/\/mvnrepository.com\/search?q=playwright\" style=\"outline: none;\" target=\"_blank\" rel=\"noopener\">https:\/\/mvnrepository.com\/search?q=playwright<\/a><\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3015\" width=\"1198\" data-init-width=\"1198\" height=\"932\" data-init-height=\"932\" title=\"4\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/4-1.png\" data-width=\"1198\" data-height=\"932\" style=\"aspect-ratio: auto 1198 \/ 932;\"><\/span><span><img decoding=\"async\" alt=\"\" data-id=\"3016\" width=\"1198\" data-init-width=\"1198\" height=\"816\" data-init-height=\"816\" title=\"5\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/5-1.png\" data-width=\"1198\" data-height=\"816\" style=\"aspect-ratio: auto 1198 \/ 816;\"><\/span><\/p>\n<p>Save xml to automatically download playwright jars<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3017\" width=\"1198\" data-init-width=\"1198\" height=\"618\" data-init-height=\"618\" title=\"6\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/6-1.png\" data-width=\"1198\" data-height=\"618\" style=\"aspect-ratio: auto 1198 \/ 618;\"><\/span><\/p>\n<p><b><u>Add <\/u><\/b><b>maven dependency for \u2018JUnit Jupiter Engine\u2019<\/b><\/p>\n<p>Similarly let us add \u2018JUnit Jupiter Engine\u2019 dependency<\/p>\n<p><a href=\"https:\/\/mvnrepository.com\/artifact\/org.junit.jupiter\/junit-jupiter-engine\" style=\"outline: none;\" target=\"_blank\" rel=\"noopener\">https:\/\/mvnrepository.com\/artifact\/org.junit.jupiter\/junit-jupiter-engine<\/a><\/p>\n<p>If you don\u2019t add this dependency, you might get below exception while executing playwright tests:<\/p>\n<p>java.lang.NoClassDefFoundError: org\/junit\/platform\/engine\/EngineExecutionListener<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3018\" width=\"1198\" data-init-width=\"1198\" height=\"1022\" data-init-height=\"1022\" title=\"7\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/7-1.png\" data-width=\"1198\" data-height=\"1022\" style=\"aspect-ratio: auto 1198 \/ 1022;\"><\/span><\/p>\n<p>Save xml to download the Jupiter-engine jar<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3019\" width=\"1198\" data-init-width=\"1198\" height=\"708\" data-init-height=\"708\" title=\"8\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/8.png\" data-width=\"1198\" data-height=\"708\" style=\"aspect-ratio: auto 1198 \/ 708;\"><\/span><\/p>\n<p><b>JavaSE-1.8 configuration<\/b><\/p>\n<p>If you are getting an error: \u2018References to static interface methods are allowed only at source level 1.8 or above\u2019, than perform below steps:<\/p>\n<p>Right click project &gt; click properties and further click \u2018Java Build Path\u2019 &gt; click libraries and select \u2018JRE System Library\u2019 &gt; click \u2018Edit\u2019 and select \u2018JavaSE-1.8 (jre1.8.0)\u2019<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3020\" width=\"1198\" data-init-width=\"1198\" height=\"708\" data-init-height=\"708\" title=\"Screenshot 2025-01-14 at 7.08.55\u202fPM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-14-at-7.08.55\u202fPM.png\" data-width=\"1198\" data-height=\"708\" style=\"aspect-ratio: auto 1198 \/ 708;\"><\/span><\/p>\n<p>Click \u2018Finish\u2019, \u2018Apply and close\u2019 &gt; \u2018JRE System Library [JavaSE-<b>1.8<\/b>]\u2019 should now be seen<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3021\" width=\"1198\" data-init-width=\"1198\" height=\"708\" data-init-height=\"708\" title=\"Screenshot 2025-01-14 at 7.09.32\u202fPM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-14-at-7.09.32\u202fPM.png\" data-width=\"1198\" data-height=\"708\" style=\"aspect-ratio: auto 1198 \/ 708;\"><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>We have done the playwright project setup.<\/p>\n<p>In our next blog, we will create and execute the first playwright java program.<\/p>\n<p>Thank you for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, you will learn how to create a Playwright Java project in the Eclipse IDE. You will also learn how to add the maven dependencies such as: Junit jupiter, Junit jupiter params, Junit playwright and JUnit Jupiter Engine. Additionally, you will configure JavaSE-1-1.8 and create a Java maven playwright project in eclipse. Topics [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":750,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2839","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","post-wrapper","thrv_wrapper"],"_links":{"self":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2839"}],"version-history":[{"count":22,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2839\/revisions"}],"predecessor-version":[{"id":3687,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2839\/revisions\/3687"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/750"}],"wp:attachment":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}