sridharbandi / Java-a11y

Accessibility Automated Testing with Java Selenium
https://sridharbandi.github.io/Java-a11y/
MIT License
12 stars 12 forks source link

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

Closed anukodali83 closed 1 year ago

anukodali83 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

yes, but i am not seeing any reports

anukodali83 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

anukodali83 commented 1 year ago

image

anukodali83 commented 1 year ago

image

anukodali83 commented 1 year ago

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

sridharbandi commented 1 year ago

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

anukodali83 commented 1 year ago

sure, will try

anukodali83 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

ok, but when i add jar

image

sridharbandi commented 1 year ago

ok, but when i add jar

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

anukodali83 commented 1 year ago

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

sure , will try

anukodali83 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

Hi Sridhar , waitForLoad() method is called inside execute method

On Fri, Jan 27, 2023 at 6:19 PM Sridhar Bandi @.***> wrote:

@sridharbandi https://github.com/sridharbandi tried 4.5.0

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

@anukodali83 https://github.com/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

— Reply to this email directly, view it on GitHub https://github.com/sridharbandi/Java-a11y/issues/25#issuecomment-1406912234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKEWG754NRZT35CKQ33WOXLWUQGUVANCNFSM6AAAAAAUIRFQQE . You are receiving this because you were mentioned.Message ID: @.***>

-- Regards Annapurna 623-628-4866 / 385-888-2499

anukodali83 commented 1 year ago

And this waitForLoad method is having this driver pageLoad method which is causing issue I will revisit this on Monday and will get back to you

Thanks 🙏

On Fri, Jan 27, 2023 at 11:31 PM anu kodali @.***> wrote:

Hi Sridhar , waitForLoad() method is called inside execute method

On Fri, Jan 27, 2023 at 6:19 PM Sridhar Bandi @.***> wrote:

@sridharbandi https://github.com/sridharbandi tried 4.5.0

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

@anukodali83 https://github.com/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

— Reply to this email directly, view it on GitHub https://github.com/sridharbandi/Java-a11y/issues/25#issuecomment-1406912234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKEWG754NRZT35CKQ33WOXLWUQGUVANCNFSM6AAAAAAUIRFQQE . You are receiving this because you were mentioned.Message ID: @.***>

-- Regards Annapurna 623-628-4866 / 385-888-2499

-- Regards Annapurna 623-628-4866 / 385-888-2499

sridharbandi commented 1 year ago

@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 commented 1 year ago

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

sridharbandi commented 1 year ago

Great. Closing it.