Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to generate report with java-a11y-3.0.2 jar file #25

Closed
anukodali83 opened this issue Jan 27, 2023 · 28 comments
Closed

unable to generate report with java-a11y-3.0.2 jar file #25

anukodali83 opened this issue Jan 27, 2023 · 28 comments

Comments

@anukodali83
Copy link

Hi @sridharbandi , this was super helpful to achieve accessibility automation. Thanks a lot for this wonderful work.

I am facing issue with report, reports are not getting generated , i downloaded the jar : java-a11y-3.0.2 jar file and added to my intellij and here is my code looks like

HtmlCsRunner htmlCsRunner = new HtmlCsRunner(driver);
htmlCsRunner.setStandard(HTMLCS.WCAG2AAA);
htmlCsRunner.setPageTile("LP").execute();
htmlCsRunner.generateHtmlReport();

i am not able to add the line : Accessibility.REPORT_PATH = System.getProperty("user.dir")+"/target/accessibility in my before suite, looks like REPORT_PATH reference cannot be found

@sridharbandi
Copy link
Owner

Hi @anukodali83, in latest release you don't need to explicitly provide the report Path.
htmlCsRunner.generateHtmlReport(); this line will generate the report in path /target/java-a11y/htmlcs

@anukodali83
Copy link
Author

yes, but i am not seeing any reports

@anukodali83
Copy link
Author

anukodali83 commented Jan 27, 2023

i removed that line in before suites and i am not seeing any folder with name java-a11y in my targets folder

this will be created automatically correct @sridharbandi , i dont need to explicitly create folders with those name right?

@anukodali83
Copy link
Author

anukodali83 commented Jan 27, 2023

i just have below code and jar file added to my class path in intellij

it would be great help if you can help us with this issue.. Thanks

HtmlCsRunner htmlCsRunner = new HtmlCsRunner(driver);
htmlCsRunner.setStandard(HTMLCS.WCAG2AAA);
htmlCsRunner.setPageTile("LP").execute();
htmlCsRunner.generateHtmlReport();

@sridharbandi
Copy link
Owner

Any error it is throwing? Any error screenshots will be helpful for me to debug the issue.

@anukodali83
Copy link
Author

image

@anukodali83
Copy link
Author

image

@anukodali83
Copy link
Author

anukodali83 commented Jan 27, 2023

no exception either @sridharbandi ,i dont see any error or exception, but not seeing the reports

@sridharbandi
Copy link
Owner

@anukodali83, as you are using maven project, refer this example https://github.com/sridharbandi/Java-a11y-example

@anukodali83
Copy link
Author

sure, will try

@anukodali83
Copy link
Author

anukodali83 commented Jan 27, 2023

it worked , thanks a lot, but what jar should i use --same java-a11y-3.0.2 jar file ?? @sridharbandi

when i run the project you shared it is working fine... but when i try to integrate this jar file in my project and test---not working, reports not generating

i cannot have this pom dependecy---i can only include jar file

can you please relase the jar or help me findign the right jar version...Thank you so much @sridharbandi

@sridharbandi
Copy link
Owner

Hi @anukodali83
If you executed the project I shared in the same PC, then including POM dependency in the original project should work. Both are same versions.
I tried even added the local jar to class path, and it is generating the report
image

@anukodali83
Copy link
Author

anukodali83 commented Jan 27, 2023

with the jar version i am not able to generate report...can you please help
with the project you shared , able to see the reports
i don't see any release version in https://github.com/sridharbandi/Java-a11y-example
could please help here @sridharbandi

@sridharbandi
Copy link
Owner

sridharbandi commented Jan 27, 2023

@anukodali83 Is it possible to share your full snippet/project? There should be some sort of error it will generate if the reports are not generating. Can you try debugging it?

@anukodali83
Copy link
Author

anukodali83 commented Jan 27, 2023

@sridharbandi if i remove the jar and tried to use , i am getting below error, my organirsation may not let to use this

io.github.sridharbandi
java-a11y
3.0.2

image

@sridharbandi
Copy link
Owner

sridharbandi commented Jan 27, 2023

@anukodali83, if your organization is not allowing you to download, then this example project https://github.com/sridharbandi/Java-a11y-example should also not work.
As you mentioned, example project is working, I strongly believe it should work.

@anukodali83
Copy link
Author

ok, but when i add jar

image

@sridharbandi
Copy link
Owner

ok, but when i add jar

image
Trying debugging your code and see if you are seeing any errors.

@anukodali83
Copy link
Author

ok, but when i add jar
image
Trying debugging your code and see if you are seeing any errors.

sure , will try

@anukodali83
Copy link
Author

@sridharbandi i am getting error at axeRunner.execute();

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.(Lorg/openqa/selenium/WebDriver;Ljava/time/Duration;)V

at io.github.sridharbandi.util.A11y.waitForLoad(A11y.java:62)
at io.github.sridharbandi.util.A11y.execute(A11y.java:46)
at io.github.sridharbandi.AxeRunner.execute(AxeRunner.java:27)

@sridharbandi
Copy link
Owner

@sridharbandi i am getting error at axeRunner.execute();

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.(Lorg/openqa/selenium/WebDriver;Ljava/time/Duration;)V

at io.github.sridharbandi.util.A11y.waitForLoad(A11y.java:62)
at io.github.sridharbandi.util.A11y.execute(A11y.java:46)
at io.github.sridharbandi.AxeRunner.execute(AxeRunner.java:27)

@anukodali83 looks like you are using Selenium v3.xx.x. Please update your Selenium v4.xx.x. It should work.

@anukodali83
Copy link
Author

anukodali83 commented Jan 27, 2023

@sridharbandi tried 4.5.0

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.(Lorg/openqa/selenium/WebDriver;Ljava/time/Duration;)V

java: method pageLoadTimeout in interface org.openqa.selenium.WebDriver.Timeouts cannot be applied to given types;
required: long,java.util.concurrent.TimeUnit
found: java.time.Duration
reason: actual and formal argument lists differ in length

any specidific version i can refer to

@sridharbandi
Copy link
Owner

@sridharbandi tried 4.5.0

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.(Lorg/openqa/selenium/WebDriver;Ljava/time/Duration;)V

@anukodali83 If you're still getting this error, it means your project is not properly referring to v4.5.0, or it might be conflicts with multiple versions of selenium

java: method pageLoadTimeout in interface org.openqa.selenium.WebDriver.Timeouts cannot be applied to given types; required: long,java.util.concurrent.TimeUnit found: java.time.Duration reason: actual and formal argument lists differ in length

This error doesn't seem to be from java-a11y library. I haven't used pageLoadTimeout method anywhere.

any specidific version i can refer to

It should work with v4.5.0

@anukodali83
Copy link
Author

anukodali83 commented Jan 27, 2023 via email

@anukodali83
Copy link
Author

anukodali83 commented Jan 27, 2023 via email

@sridharbandi
Copy link
Owner

sridharbandi commented Jan 28, 2023

@anukodali83, below is the waitForLoad method, and it doesn't have pageLoadTimeout method. Duration will throw error if you are not using selenium version 4. If you are still getting error after using Selenium 4 means you do have some with conflicts with multiple versions of selenium.

private void waitForLoad() { WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30)); wait.until(wd -> javascriptExecutor.executeScript("return document.readyState").equals("complete")); }

@anukodali83
Copy link
Author

anukodali83 commented Jan 29, 2023

Thanks a lot @sridharbandi , this worked like a chram....thanks a lot for the great support

@sridharbandi
Copy link
Owner

Great. Closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants