{"id":3537,"date":"2025-01-16T20:02:59","date_gmt":"2025-01-16T20:02:59","guid":{"rendered":"https:\/\/rahulshettyacademy.com\/blog\/?p=3537"},"modified":"2025-01-17T10:53:41","modified_gmt":"2025-01-17T10:53:41","slug":"allure-report-generation-using-playwright-java","status":"publish","type":"post","link":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2025\/01\/16\/allure-report-generation-using-playwright-java\/","title":{"rendered":"Allure Report generation using Playwright Java\u00a0"},"content":{"rendered":"<p><em>In this blog we will be utilizing Playwright Java to generate allure reports.<\/em><\/p>\n<p><strong>Topics that we will cover:<\/strong><\/p>\n<ul>\n<li>Add aspectj version in the properties section of pom.xml<\/li>\n<li>Add 3 properties in the properties section of pom.xml<\/li>\n<li>Add maven allure testng dependency<\/li>\n<li>Add \u2018aspectjweaver\u2019 setting in pom.xml<\/li>\n<li>Maven install<\/li>\n<li>Run any sample testng test<\/li>\n<li>Manually install allure commandline<\/li>\n<li>Execute \u201callure serve allure-results\u201d<\/li>\n<li>POM.xml<\/li>\n<li>Source code<\/li>\n<\/ul>\n<p><strong>Add aspectj version in the properties section of pom.xml &nbsp;<\/strong><\/p>\n<p>Copy below section<\/p>\n<p><em>&lt;properties&gt;<\/em><\/p>\n<p><em>&lt;aspectj.version&gt;1.8.10&lt;\/aspectj.version&gt;<\/em><\/p>\n<p><em>&lt;\/properties&gt;<\/em><\/p>\n<p>Paste it in the propertes section of pom.xml<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3540\" width=\"685\" data-init-width=\"1174\" height=\"302\" data-init-height=\"518\" title=\"Screenshot 2025-01-17 at 1.34.32\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.34.32\u202fAM.png\" data-width=\"685\" data-height=\"302\" style=\"aspect-ratio: auto 1174 \/ 518;\"><\/span><\/p>\n<p>&nbsp;<strong>Add 3 properties in the properties section of pom.xml<\/strong><\/p>\n<p>We will now copy and paste 3 properties in \u2018properties\u2019 tag section<\/p>\n<p><em>&lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;&lt;maven.compiler.source&gt;1.8&lt;\/maven.compiler.source&gt;&lt;maven.compiler.target&gt;1.8&lt;\/maven.compiler.target&gt;<\/em><\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3541\" width=\"641\" data-init-width=\"1174\" height=\"127\" data-init-height=\"232\" title=\"Screenshot 2025-01-17 at 1.35.16\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.35.16\u202fAM.png\" data-width=\"641\" data-height=\"127\" style=\"aspect-ratio: auto 1174 \/ 232;\"><\/span><\/p>\n<p><strong>Add maven allure testng dependency<\/strong><\/p>\n<p>Next we will copy the latest (stable) maven allure testng dependency<\/p>\n<p>https:\/\/mvnrepository.com\/artifact\/io.qameta.allure\/allure-testng\/2.26.0&nbsp;<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3542\" width=\"669\" data-init-width=\"1174\" height=\"422\" data-init-height=\"740\" title=\"Screenshot 2025-01-17 at 1.36.01\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.36.01\u202fAM.png\" data-width=\"669\" data-height=\"422\" style=\"aspect-ratio: auto 1174 \/ 740;\"><\/span><\/p>\n<p>Save xml.<\/p>\n<p><strong>Add \u2018aspectjweaver\u2019 setting in pom.xml<\/strong><\/p>\n<p>Copy below snippet<\/p>\n<p><em>&lt;build&gt; &nbsp;<\/em><em>&lt;plugins&gt;<\/em><em>&nbsp; &nbsp; &lt;plugin&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;artifactId&gt;maven-surefire-plugin&lt;\/artifactId&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;version&gt;2.20&lt;\/version&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;configuration&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;argLine&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -javaagent:&#8221;${settings.localRepository}orgaspectjaspectjweaver${aspectj.version}aspectjweaver-${aspectj.version}.jar&#8221;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/argLine&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/configuration&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dependencies&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dependency&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;groupId&gt;org.aspectj&lt;\/groupId&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;artifactId&gt;aspectjweaver&lt;\/artifactId&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;version&gt;${aspectj.version}&lt;\/version&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/dependency&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/dependencies&gt;<\/em><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/plugin&gt;<\/em><em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/plugins&gt;<\/em><em>&lt;\/build&gt;<\/em>Paste it in pom.xml.Change forward slash to backward slash  in windows machine (see line#68 below)<span><img decoding=\"async\" alt=\"\" data-id=\"3543\" width=\"671\" data-init-width=\"1174\" height=\"423\" data-init-height=\"740\" title=\"Screenshot 2025-01-17 at 1.36.01\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.36.01\u202fAM-1.png\" data-width=\"671\" data-height=\"423\" style=\"aspect-ratio: auto 1174 \/ 740;\"><\/span>&nbsp;<\/p>\n<p>Save xml.<\/p>\n<p><strong>Maven install<\/strong><\/p>\n<p>Right click xml &gt; Run As &gt; Maven Install<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3544\" width=\"642\" data-init-width=\"1174\" height=\"230\" data-init-height=\"420\" title=\"Screenshot 2025-01-17 at 1.37.41\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.37.41\u202fAM.png\" data-width=\"642\" data-height=\"230\" style=\"aspect-ratio: auto 1174 \/ 420;\"><\/span><\/p>\n<p>\u201cBUILD SUCCESS\u201d message should be seen in console<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3545\" width=\"632\" data-init-width=\"1174\" height=\"742\" data-init-height=\"1378\" title=\"Screenshot 2025-01-17 at 1.38.17\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.38.17\u202fAM.png\" data-width=\"632\" data-height=\"742\" style=\"aspect-ratio: auto 1174 \/ 1378;\"><\/span><\/p>\n<p>&nbsp;The test gets passed<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3546\" width=\"658\" data-init-width=\"1174\" height=\"358\" data-init-height=\"638\" title=\"Screenshot 2025-01-17 at 1.38.55\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.38.55\u202fAM.png\" data-width=\"658\" data-height=\"358\" style=\"aspect-ratio: auto 1174 \/ 638;\"><\/span><\/p>\n<p>&nbsp;<strong>Manually install allure commandline&nbsp;<\/strong><\/p>\n<p>Go to<\/p>\n<p><a href=\"https:\/\/repo.maven.apache.org\/maven2\/io\/qameta\/allure\/allure-commandline\/\" style=\"outline: none;\" target=\"_blank\" rel=\"noopener\">https:\/\/repo.maven.apache.org\/maven2\/io\/qameta\/allure\/allure-commandline\/<\/a>&nbsp;<\/p>\n<p>Look for the latest version<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3547\" width=\"644\" data-init-width=\"1174\" height=\"368\" data-init-height=\"670\" title=\"Screenshot 2025-01-17 at 1.39.36\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.39.36\u202fAM.png\" data-width=\"644\" data-height=\"368\" style=\"aspect-ratio: auto 1174 \/ 670;\"><\/span><\/p>\n<p>&nbsp;Click latest version and look for windows zip file<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3548\" width=\"645\" data-init-width=\"1174\" height=\"343\" data-init-height=\"624\" title=\"Screenshot 2025-01-17 at 1.40.16\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.40.16\u202fAM.png\" data-width=\"645\" data-height=\"343\" style=\"aspect-ratio: auto 1174 \/ 624;\"><\/span><\/p>\n<p>&nbsp;Click the zip file to download the same<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3549\" width=\"632\" data-init-width=\"1174\" height=\"438\" data-init-height=\"814\" title=\"Screenshot 2025-01-17 at 1.41.06\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.41.06\u202fAM.png\" data-width=\"632\" data-height=\"438\" style=\"aspect-ratio: auto 1174 \/ 814;\"><\/span><\/p>\n<p>&nbsp;Copy the above path upto bin folder&nbsp;<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3550\" width=\"633\" data-init-width=\"1174\" height=\"311\" data-init-height=\"576\" title=\"Screenshot 2025-01-17 at 1.41.51\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.41.51\u202fAM.png\" data-width=\"633\" data-height=\"311\" style=\"aspect-ratio: auto 1174 \/ 576;\"><\/span><\/p>\n<p>&nbsp;Open command propmt and execute \u2018<em>allure &#8211;version<\/em>\u2019 command to see the allure version<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3551\" width=\"568\" data-init-width=\"1174\" height=\"365\" data-init-height=\"754\" title=\"Screenshot 2025-01-17 at 1.42.27\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.42.27\u202fAM.png\" data-width=\"568\" data-height=\"365\" style=\"aspect-ratio: auto 1174 \/ 754;\"><\/span><span><img decoding=\"async\" alt=\"\" data-id=\"3552\" width=\"576\" data-init-width=\"1174\" height=\"493\" data-init-height=\"1004\" title=\"Screenshot 2025-01-17 at 1.43.43\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.43.43\u202fAM.png\" data-width=\"576\" data-height=\"493\" style=\"aspect-ratio: auto 1174 \/ 1004;\"><\/span><\/p>\n<p><strong>Execute \u201callure serve allure-results\u201d<\/strong><\/p>\n<p>Execute the command \u201c<em>allure serve allure-results<\/em>\u201d<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3553\" width=\"778\" data-init-width=\"1174\" height=\"314\" data-init-height=\"474\" title=\"Screenshot 2025-01-17 at 1.44.37\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.44.37\u202fAM.png\" data-width=\"778\" data-height=\"314\" style=\"aspect-ratio: auto 1174 \/ 474;\"><\/span><span><img decoding=\"async\" alt=\"\" data-id=\"3554\" width=\"761\" data-init-width=\"1174\" height=\"976\" data-init-height=\"1506\" title=\"Screenshot 2025-01-17 at 1.45.29\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.45.29\u202fAM.png\" data-width=\"761\" data-height=\"976\" style=\"aspect-ratio: auto 1174 \/ 1506;\"><\/span><\/p>\n<p>&nbsp;The report gets launched and it shows the overview of 1 test that was executed successfully<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3555\" width=\"743\" data-init-width=\"1174\" height=\"766\" data-init-height=\"1210\" title=\"Screenshot 2025-01-17 at 1.46.17\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.46.17\u202fAM.png\" data-width=\"743\" data-height=\"766\" style=\"aspect-ratio: auto 1174 \/ 1210;\"><\/span><\/p>\n<p>&nbsp;Below is \u2018Graphs\u2019 representation<\/p>\n<p><span><img decoding=\"async\" alt=\"\" data-id=\"3556\" width=\"718\" data-init-width=\"1174\" height=\"1014\" data-init-height=\"1658\" title=\"Screenshot 2025-01-17 at 1.48.34\u202fAM\" loading=\"lazy\" src=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2025\/01\/Screenshot-2025-01-17-at-1.48.34\u202fAM.png\" data-width=\"718\" data-height=\"1014\" style=\"aspect-ratio: auto 1174 \/ 1658;\"><\/span><\/p>\n<p>&nbsp;This is how allure report can be generated using playwright.<\/p>\n<p><strong>pom.xml<\/strong><\/p>\n<p>&lt;project xmlns=&#8221;http:\/\/maven.apache.org\/POM\/4.0.0&#8243;<\/p>\n<p>xmlns:xsi=&#8221;http:\/\/www.w3.org\/2001\/XMLSchema-instance&#8221;<\/p>\n<p>xsi:schemaLocation=&#8221;http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd&#8221;&gt;<\/p>\n<p>&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;<\/p>\n<p>&lt;groupId&gt;com.rahulshettyacademy&lt;\/groupId&gt;<\/p>\n<p>&lt;artifactId&gt;PlaywrightJava&lt;\/artifactId&gt;<\/p>\n<p>&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;<\/p>\n<\/p>\n<p>&lt;properties&gt;<\/p>\n<p>&lt;aspectj.version&gt;1.8.10&lt;\/aspectj.version&gt;<\/p>\n<p>&lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;<\/p>\n<p>&lt;maven.compiler.source&gt;1.8&lt;\/maven.compiler.source&gt;<\/p>\n<p>&lt;maven.compiler.target&gt;1.8&lt;\/maven.compiler.target&gt;<\/p>\n<\/p>\n<p>&lt;\/properties&gt;<\/p>\n<\/p>\n<p>&lt;dependencies&gt;<\/p>\n<p>&lt;dependency&gt;<\/p>\n<p>&lt;groupId&gt;org.junit.jupiter&lt;\/groupId&gt;<\/p>\n<p>&lt;artifactId&gt;junit-jupiter-api&lt;\/artifactId&gt;<\/p>\n<p>&lt;version&gt;5.10.1&lt;\/version&gt;<\/p>\n<p>&lt;scope&gt;test&lt;\/scope&gt;<\/p>\n<p>&lt;\/dependency&gt;<\/p>\n<p>&lt;dependency&gt;<\/p>\n<p>&lt;groupId&gt;org.junit.jupiter&lt;\/groupId&gt;<\/p>\n<p>&lt;artifactId&gt;junit-jupiter-params&lt;\/artifactId&gt;<\/p>\n<p>&lt;version&gt;5.10.1&lt;\/version&gt;<\/p>\n<p>&lt;scope&gt;test&lt;\/scope&gt;<\/p>\n<p>&lt;\/dependency&gt;<\/p>\n<p>&lt;dependency&gt;<\/p>\n<p>&lt;groupId&gt;com.microsoft.playwright&lt;\/groupId&gt;<\/p>\n<p>&lt;artifactId&gt;playwright&lt;\/artifactId&gt;<\/p>\n<p>&lt;version&gt;1.40.0&lt;\/version&gt;<\/p>\n<p>&lt;\/dependency&gt;<\/p>\n<p>&lt;dependency&gt;<\/p>\n<p>&lt;groupId&gt;org.junit.jupiter&lt;\/groupId&gt;<\/p>\n<p>&lt;artifactId&gt;junit-jupiter-engine&lt;\/artifactId&gt;<\/p>\n<p>&lt;version&gt;5.10.1&lt;\/version&gt;<\/p>\n<p>&lt;scope&gt;test&lt;\/scope&gt;<\/p>\n<p>&lt;\/dependency&gt;<\/p>\n<p>&lt;dependency&gt;<\/p>\n<p>&lt;groupId&gt;com.google.code.gson&lt;\/groupId&gt;<\/p>\n<p>&lt;artifactId&gt;gson&lt;\/artifactId&gt;<\/p>\n<p>&lt;version&gt;2.10.1&lt;\/version&gt;<\/p>\n<p>&lt;\/dependency&gt;<\/p>\n<p>&lt;dependency&gt;<\/p>\n<p>&lt;groupId&gt;org.testng&lt;\/groupId&gt;<\/p>\n<p>&lt;artifactId&gt;testng&lt;\/artifactId&gt;<\/p>\n<p>&lt;version&gt;7.9.0&lt;\/version&gt;<\/p>\n<p>&lt;scope&gt;test&lt;\/scope&gt;<\/p>\n<p>&lt;\/dependency&gt;<\/p>\n<p>&lt;dependency&gt;<\/p>\n<p>&lt;groupId&gt;io.qameta.allure&lt;\/groupId&gt;<\/p>\n<p>&lt;artifactId&gt;allure-testng&lt;\/artifactId&gt;<\/p>\n<p>&lt;version&gt;2.26.0&lt;\/version&gt;<\/p>\n<p>&lt;\/dependency&gt;<\/p>\n<p>&lt;\/dependencies&gt;<\/p>\n<\/p>\n<p>&lt;build&gt;<\/p>\n<p>&lt;plugins&gt;<\/p>\n<p>&lt;plugin&gt;<\/p>\n<p>&lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;<\/p>\n<p>&lt;artifactId&gt;maven-surefire-plugin&lt;\/artifactId&gt;<\/p>\n<p>&lt;version&gt;2.20&lt;\/version&gt;<\/p>\n<p>&lt;configuration&gt;<\/p>\n<\/p>\n<p>&lt;argLine&gt;<\/p>\n<p>-javaagent:&#8221;${settings.localRepository}orgaspectjaspectjweaver${aspectj.version}aspectjweaver-${aspectj.version}.jar&#8221;<\/p>\n<p>&lt;\/argLine&gt;<\/p>\n<p>&lt;\/configuration&gt;<\/p>\n<p>&lt;dependencies&gt;<\/p>\n<p>&lt;dependency&gt;<\/p>\n<p>&lt;groupId&gt;org.aspectj&lt;\/groupId&gt;<\/p>\n<p>&lt;artifactId&gt;aspectjweaver&lt;\/artifactId&gt;<\/p>\n<p>&lt;version&gt;${aspectj.version}&lt;\/version&gt;<\/p>\n<p>&lt;\/dependency&gt;<\/p>\n<p>&lt;\/dependencies&gt;<\/p>\n<p>&lt;\/plugin&gt;<\/p>\n<p>&lt;\/plugins&gt;<\/p>\n<p>&lt;\/build&gt;<\/p>\n<\/p>\n<p>&lt;\/project&gt;<\/p>\n<\/p>\n<p><strong>Source code<\/strong><\/p>\n<p><strong>package<\/strong> com.rsa.playwrightjava;<\/p>\n<\/p>\n<p><strong>import<\/strong> org.testng.annotations.AfterMethod;<\/p>\n<p><strong>import<\/strong> org.testng.annotations.BeforeMethod;<\/p>\n<p><strong>import<\/strong> org.testng.annotations.Test;<\/p>\n<p><strong>import<\/strong> com.microsoft.playwright.Browser;<\/p>\n<p><strong>import<\/strong> com.microsoft.playwright.BrowserType;<\/p>\n<p><strong>import<\/strong> com.microsoft.playwright.Locator;<\/p>\n<p><strong>import<\/strong> com.microsoft.playwright.Page;<\/p>\n<p><strong>import<\/strong> com.microsoft.playwright.Playwright;<\/p>\n<\/p>\n<p><strong>public<\/strong><strong>class<\/strong> Blog28_TestNGTest_PWJava {<\/p>\n<p><strong>private<\/strong> Browser browser;<\/p>\n<p><strong>private<\/strong> Page page;<\/p>\n<p>@BeforeMethod<\/p>\n<p><strong>public<\/strong><strong>void<\/strong> setUp() {<\/p>\n<p>Playwright playwright = Playwright.<em>create<\/em>();&nbsp;<\/p>\n<p>browser = playwright.chromium().launch(<strong>new<\/strong> BrowserType.LaunchOptions().setHeadless(<strong>false<\/strong>));<\/p>\n<p>page = browser.newPage();<\/p>\n<p>}<\/p>\n<p>@Test<\/p>\n<p><strong>public<\/strong><strong>void<\/strong> test_1() {<\/p>\n<p>page.navigate(&#8220;https:\/\/the-internet.herokuapp.com\/iframe&#8221;);<\/p>\n<p>Locator frame1 = page.frameLocator(&#8220;#mce_0_ifr&#8221;).locator(&#8220;html&#8221;);<\/p>\n<p>frame1.click();<\/p>\n<p>frame1.type(&#8220;https:\/\/rahulshettyacademy.com&#8221;);<\/p>\n<p>}<\/p>\n<p>@AfterMethod<\/p>\n<p><strong>public<\/strong><strong>void<\/strong> tearDown() {<\/p>\n<p>page.pause();<\/p>\n<p>browser.close();<\/p>\n<p>page.close();<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog we will be utilizing Playwright Java to generate allure reports. Topics that we will cover: Add aspectj version in the properties section of pom.xml Add 3 properties in the properties section of pom.xml Add maven allure testng dependency Add \u2018aspectjweaver\u2019 setting in pom.xml Maven install Run any sample testng test Manually install [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":750,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"class_list":["post-3537","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-playwright","post-wrapper","thrv_wrapper"],"_links":{"self":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3537","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=3537"}],"version-history":[{"count":6,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3537\/revisions"}],"predecessor-version":[{"id":3748,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3537\/revisions\/3748"}],"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=3537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=3537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=3537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}