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

Baseline exception in selenium Java #2077

Open
shunguoy opened this issue Oct 25, 2024 · 1 comment · May be fixed by #2078
Open

Baseline exception in selenium Java #2077

shunguoy opened this issue Oct 25, 2024 · 1 comment · May be fixed by #2078
Assignees
Labels
java-accessibility-checker Issues related to the Java accessibility-checker user-reported Issues identified outside of the core team

Comments

@shunguoy
Copy link
Contributor

shunguoy commented Oct 25, 2024

user reported from Slack: https://ibm-studios.slack.com/archives/C036P1CTN/p1729821107094459

I'm using the selenium java accessibility checker. I was trying to use the baselines and I'm seeing a null pointer exception. My baseline has 53 items but my actual has 60 and it's blowing up on this line with
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 53
at com.ibm.able.equalaccess.report.BaselineManager.diff(BaselineManager.java:273)
at com.ibm.able.equalaccess.report.BaselineManager.diffResultsWithExpected(BaselineManager.java:208)
at com.ibm.able.equalaccess.report.BaselineManager.assertCompliance(BaselineManager.java:135)
at com.ibm.able.equalaccess.AccessibilityChecker.assertCompliance(AccessibilityChecker.java:93)
Screenshot 2024-09-16 at 8.22.43 PM.png

Screenshot 2024-09-16 at 8.22.43 PM.png

@shunguoy shunguoy changed the title Baseline exception Baseline exception in selenium Java Oct 25, 2024
@amyreit
Copy link

amyreit commented Oct 25, 2024

I could be using the calls incorrectly but if so, can you please tell me how to compare the current report to my baseline. I was trying to do this thinking that if they didn't match, the assertCompliance call would return BASELINE_MISMATCH but stepping through the code, that's never going to work if they aren't the same size. In my case, the baseline file had 25 elements but the actual file had 35:

        matchBaseline = AccessibilityChecker.assertCompliance(report);
             if (matchBaseline==eAssertResult.BASELINE_MISMATCH) {
                   // handle a failure here
            }

I also tried this way :

ACReport baselineRpt = AccessibilityChecker.getBaseline(pageForComplianceCheck);
           DiffResult[] diffs = AccessibilityChecker.diffResultsWithExpected(report, baselineRpt);

but hits same line of code eventually and fails the same way.

Here's the code in BaselineManager.java:273. It fails here because the for loop is going from the expected length of 25 to the actual length of 35 and so right away expectedRs[25] is out of index since my expected file only has 0-24 elements.

for (int idx=expectedRs.length; idx < actualRs.length; ++idx) {
           retVal.add(new DiffResult("A", idx, gson.toJson(expectedRs[idx]), null));  
       }

@MHoov MHoov added user-reported Issues identified outside of the core team java-accessibility-checker Issues related to the Java accessibility-checker labels Oct 28, 2024
@tombrunet tombrunet self-assigned this Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java-accessibility-checker Issues related to the Java accessibility-checker user-reported Issues identified outside of the core team
Projects
None yet
4 participants