Closed OmarElfatatry closed 2 years ago
What happens when you open chrome window (or any other browser) and paste the url? Also what are the parameters in the URL, is it appended by intellij?
Thank you for your fast reply If I paste this URL in a browser that is opened when I right-click on the report in IntelliJ (Open in --> browser --> chrome)
The same error appeared to me "404 Not Found", but if I try to open it from windows explorer it's working as intended
There is a difference between the two paths. Maybe it is some configuration. Are u running a web server at this port? I am not that familiar with intellij.
I didn't run any webserver and this is the extent.properties file
extent.reporter.html.start=true
extent.reporter.html.config=src/test/resources/html-config.xml
extent.reporter.html.out=target/Report.html
And this is the html-config.xml file
<?xml version="1.0" encoding="UTF-8"?>
And finally, this is the pom.xml file
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>org.example</groupId>
<artifactId>Cucumber_Try</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>7.2.3</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.2.3</version>
</dependency>
<dependency>
<groupId>tech.grasshopper</groupId>
<artifactId>extentreports-cucumber7-adapter</artifactId>
<version>1.3.0</version>
</dependency>
</dependencies>
This looks correct. Can u generate the spark report which is also html based. Check if it works from intellij
Unfortunately I generate it and I get the same error
Anyways, could you please help me take screenshots for failed scenarios inside the report?
Sir how to configure "screenshot.rel.path" if the HTML report and the screenshots are in the same directory?
Add screenshot.rel.path=./
Alright, thanks man it's working. By the way, the HTML 404 error is fixed when I try it for another project and it's working right now correctly so it's seemed that's there's something wrong related to this only specific project as it's working for any new project.
😁
After generating the report and trying to open it in the chrome browser from IntelliJ IDE it gives me the error "404 Not Found" and the URL is like this
http://localhost:63342/Cucumber_Try%20-%20Copy/Cucumber_Try/target/Report.html?_ijt=s1lilo6mimu3mtjk5vhm1evv0s&_ij_reload=RELOAD_ON_SAVE
But if I try to open it from windows explorer it's working as intended and the URL is
file:///C:/Users/OmarTarek/Pictures/Cucumber_Try%20-%20Copy/target/Report.html
So why I can't open it directly from IntelliJ? please help me and thank you