Scenario failed or 1 page tested

Hello @mfaure,

I have an issue with Asqatasun failing an audit scenario for an important target. I’ve seen the old similar topics where there was also 1 page tested, but it’s not the same, that’s why I’m opening a different one.

My scenario is running in SeleniumIDE, but when I launch an audit, it fails and redirect me to the login page when I want to go to another page. Here’s the logs bellow:
I’m sorry for the length of the logs, just so you can understand what’s really happening.



Here’s what my scenario should do :
I start from the login page, I enter my credentials, and click a skip button (from step 1 to 6), then I’m redirected to the home page (until here it seems ok from the logs).
In the home page I click on another button that will show me a popup (step 7 was more for debugging to see if Asqatasun sees the button or not, it seems not). Step 8 which we don’t have was when we click on that button and get directed to our second page.

What I don’t get is why at the step 7 we have : Fire new page (home page) and we have the login page as last visited URL?
And right after, it seems like if it does another attempt (not sure), and got Collection is empty!
I also don’t get the meaning of : The result of the test is set to Not tested.

Here’s the given audit in Asqatasun:


The one page tested is the login page.

Can you please give us some clues ?

Thank you so much for you help!
Anass

Hello again,

I’m still trying to understand the problem on the meantime, and I’ve found this in the source code in the invoke function.
File location : engine/scenarioloader/src/main/kotlin/org/asqatasun/scenarioloader/ScenarioLoaderImpl.kt · master · asqatasun / Asqatasun · GitLab

override fun invoke(invocation: MethodInvocation?, context: Context?, command: ICommand?, curArgs: Array<out String>?) =
        (invocation!!.proceed() as Result).also {
            waitPageFullyLoaded()
            if (command is Echo && (command).arguments[0].equals("audit", true)) {
                LOGGER.info("Fire new page ${driver.currentUrl} with echo command")
                // we could get a screenshot here for further usage (display?) by using
                // driver.getScreenshotAs(OutputType.BYTES) method
                fireNewPage(driver.currentUrl+"#"+auditStateIndex, driver.pageSource, executeJsScripts())
                auditStateIndex++
            }
            if (lastVisitedUrl != driver.currentUrl) {
                LOGGER.info("Fire new page ${driver.currentUrl}, last visited Url is $lastVisitedUrl")

                // we could get a screenshot here for further usage (display?) by using
                // driver.getScreenshotAs(OutputType.BYTES) method
                fireNewPage(driver.currentUrl, driver.pageSource, executeJsScripts())
            }
            lastVisitedUrl = driver.currentUrl
        }

I’ve seen that this method is called each time we execute a command. So why our LastVisitedURL ain’t updated right after the 6th step? It’s at this step that our URL changes!

Thanks again,
Anass

Hello @mfaure,

Did you find a solution or a suggestion for this issue please ?
It is blocking the tests we want to perform for many of our targets and therefore the use of Asqatasun as our main accessibility test tool.
I tried to build my own instance by expanding the logs and displaying the Firefox used by Asqatasun, but I have issue with CSS which I couldn’t solve by following the note in the documentation.

Thank you so much,

Hello @oanass

Thank you very much for your detailed feedback. I’m quite in a hurry on a project by now. I’ll have a look tomorrow or on wednesday :slight_smile:

1 Like

Hi @oanass

Sorry for the late answer.

So, I left apart the “last visited url” for the moment, as I saw something else. Just after step 7, 3 lines after, at Mar 10 11:38:55, we can see TypeError: elem is null, and next the description of the system (os.name: 'Linux', os.arch: 'amd64') that seems to be the information sent to the administrator when an audit fails.

So there could be an error in the scenario, when calling elem. Do you have such an element in your scenario? Can you investigate a bit further in this way?

Now a few words on the “last visited url”. Depending on how the application you’re auditing is built, the last visited url might not be relevant (for instance: kind of “too much JS” to switch from one page to another instead of a plain HTML link).

Looking forward to your feedback, and thanks again for your interest in Asqatasun! :slight_smile:

Another info: feel free to leverage or compare the scenarios examples we have published

Hello @mfaure ,
irst I’d like to thank you for the time given to answer my questions, I managed to build my own Asqatasun with more logs, unfortunately it wasn’t enough for me to understand why my scenario is stopped at some point. From the displayed firefox I can see that when I click on the grid view which should direct me to another page, I actually stay on the same page and I got this message from the logs :
[Success (the element is not visible)] URL: [https://sapwdisq03.os.amadeus.net:44347/sap/bc/ui2/flp/FioriLaunchpad.html?saml2=disabled#TimeEntry-createCustomV2&/id-1650874229482-91] / Title: [My Timesheet]
In the next step I’m supposed to type something on a box, but since the right page ain’t displayed I got this message from the logs :
Command#10: click(“id=__input0-__item9-__xmlview2–timeEntryCalendar-listViewTable-0-6-inner”) => [Failure: Error communicating with the remote browser. It may have died.

I noticed that my firefox version is 99 although I made the installation following the documentation, so it’s supposed to be 91.4.1esr, don’t if this may impact my audit.
PS: The scenario is running in Selenium IDE.

Here’s a screenshot of the Grid View button which located on a footer :


In the selenium scenario I tried to locate it differently (css finder, id, xpath, etc.), in vain.

Thank you again,
Anass

Another error from the logs :

JavaScript error: https://sapwdisq03.os.amadeus.net:44347/sap/bc/ui5_ui5/ui2/ushell/resources/~20191120123400~/sap/ushell_abap/bootstrap/evo/abap.js line 50 > eval, line 66: TypeError: sap.ui.getCore().byId(…).getController is not a function

Hi @oanass

Thank you for your kind words :blush:

We have very little information here to help you debugging, but we may try a few things.

  1. The link your trying to click on (I mean, the scenario is trying to click on) seems not to be a regular HTML link like <a href="https://example.org/my-page">my link</a>, but rather a <div> with a Javascript event listener plugged on and that would trigger a new URL call. Could you confirm this?
  2. From your second message, it seems some JS is not loaded (line 50 > eval, line 66: TypeError: sap.ui.getCore().byId(…).getController is not a function). It would be interesting to troubleshoot this error. Why .getController is not a function? What is missing? What has not been loaded?

My idea is to verify if this JS error is linked somehow to the click event that is not triggered by the scenario.

Is my purpose understandable? Do you think you could provide us with those info?

I’m eager to read your anwser :slight_smile:

Hello again @mfaure ,

Thanks again for your help, while I’m waiting to have more infos about the source code from the solution dev team, I’m still investigating myself. On the meantime I found this " at least one <footer> tag, except <footer> that is direct child of <article> and <section> tags." in Rule 9.2.1 :: Asqatasun Documentation
And here’s the structure of my HTML code :

As you can see, the button is located in a div which is inside the footer of a section, so I don’t know if this applies to the rule 9.2.1 from the documentation.
One thing is sure, Asqatasun can’t reach the new link after we click the button, I’m trying to understand if the problem comes from Asqatasun (maybe a need to add a rule) or the development of the solution itself and I should adapt it to the tool.

I’ll let you know as soon as I got more details about the solution.

Many thanks,
Anass