Description
As the title explains, running the Open With JupyterLab Menu
keyword with File, Log Out
arguments fails with the following JavaScript exception:
JavascriptException: Message: javascript error: Failed to execute 'elementsFromPoint' on 'Document': The provided double value is non-finite.
The issue seems to be that the locator used by the Click JupyterLab Menu Item keyword returns two hits when using Log Out
as the argument in a JupyterHub environment (i.e. the hub:logout
element is active instead of the filemenu:logout
one).
In a single-user environment (i.e. the filemenu:logout
element is active) the issue does not appear (because the hidden hub:logout
element does not have the Log Out
text).
There could be a number of ways to solve this issue, but before sending a PR I would like to get feedback on what would be the preferred solution. My current idea is to do a check on the ${label}
passed to the keyword, and in the case of Log Out
update the locator used to this:
//div[contains(@class, 'p-Menu-itemLabel')][text() = 'Log Out']/..[not(contains(@class,'p-mod-disabled'))]
The ..[not(contains(@class,'p-mod-disabled'))]
part will filter out the inactive element out of the two, and will work in both environments.
This could also be used for all inputs, as it should not break any existing functionality and will handle any ${label} that happens to exist twice; I have however not tested this yet on such a large scale.