Skip to content

Unable to select menu items #161

Open
@Mavnus04

Description

@Mavnus04

I am experiencing a strange situation when I go to select a menu item in this application.
Using
robotframework-flaui version 2.0.9
python 3.7.9
Robot Framework 5.0

The menu item I am trying to select is only one sub menu down like this:
image

- File
- - Exit

I have my xPath objects setup like this and I have confirmed them with FlaUInspect.exe:

WINDOW_NAME = "Simulator for Windows XP"
WINDOW_XPATH = f"/Window[@Name='{WINDOW_NAME}']"
WINDOW_MENU = {
"file": {
    "xPath": f"{WINDOW_XPATH}/MenuBar/MenuItem[@Name='File']",
    "exit": {"xPath": f"{WINDOW_XPATH}/Menu/MenuItem[@Name='Exit']"},
},

If I do back to back calls without checking if the elements exist or visible, it works.
Example:

FlaUILibrary.Focus  ${WINDOW_XPATH}
FlaUILibrary.Click Hold  ${WINDOW_MENU}[file][xPath]  1000
FlaUILibrary.Click  ${WINDOW_MENU}[file][exit][xPath]

But most of the keywords that I have written around robotframework-flaui involve checking before interacting. And when this checking is done, the menu File closes before I can click on the Exit item.
So, this fails on trying to click the exit button:

GUI Element Should Exist And Be Visible 
    [Arguments]     ${element}
    FlaUILibrary.Element Should Exist  ${element}[xPath]
    FlaUILibrary.Focus  ${element}[xPath]
    FlaUILibrary.Element Should Be Visible  ${element}[xPath]

FlaUILibrary.Focus  ${WINDOW_XPATH}
GUI Element Should Exist And Be Visible  ${WINDOW_MENU}[file]
FlaUILibrary.Click Hold  ${WINDOW_MENU}[file][xPath]  1000
FlaUILibrary.Click  ${WINDOW_MENU}[file][exit][xPath]

If I do a regular mouse click on File, the menu stays open indefinitely.

Any idea why the menu might be closing before I can click on it?
Any suggestions of something else to try?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions