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

Unable to select menu items #161

Open
Mavnus04 opened this issue Feb 29, 2024 · 5 comments
Open

Unable to select menu items #161

Mavnus04 opened this issue Feb 29, 2024 · 5 comments

Comments

@Mavnus04
Copy link

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.

@noubar
Copy link
Contributor

noubar commented Feb 29, 2024

Honestly i am not sure why it closes. But as i understood from your explanation, it is caused either by FlaUILibrary.Element Should Be Visible or FlaUILibrary.Element Should Exist keyword. As i see you are using an old version of this library.
My guess is it is caused by the Element Should Be Visible keyword, as i remember this keyword was buggy and we have removed it from keyword list exchanging it with another keyword (is element offscreen).

If it possible could you update the library and let us know if it fixes the issue!

@Mavnus04
Copy link
Author

Mavnus04 commented Feb 29, 2024

After spending several more hours on it and playing with the different robotframework-flaui keywords. It looks like just using the Focus keyword on the top level menu item File will cause it to open as if I clicked on it. This seems kind of disturbing since I didn't actually click on it. Could this be the nature of the GUI application itself or something that FlaUI is doing?

Since we are stuck at python 3.7, it looks like the highest I could go is to 2.1.1 according to the https://gdatasoftwareag.github.io/robotframework-flaui/ page. Unless that is a mistake that 2.1.2 switches to python 3.8?
image
Once you confirm the version, I'll try upgrading. Will probably need some major changes and testing on my end. Do you have a page that shows the updates from version to version?

@noubar
Copy link
Contributor

noubar commented Mar 6, 2024

@Mavnus04
https://github.com/GDATASoftwareAG/robotframework-flaui/blob/main/CHANGELOG.md#removed

here you can see last official support removed with version 3.0.0

@Mavnus04
Copy link
Author

Mavnus04 commented Mar 6, 2024

@noubar
Thank you.

Could you please update your page https://gdatasoftwareag.github.io/robotframework-flaui/ to reflect the proper python version?

Also, I tried python -m pip install --upgrade robotframework-flaui and it updated me to version 3..0.1 even though I only have python version 3.7.9 installed. I believe your python packages need to be limited to certain versions so users don't accidently update too high.

I'll play around with version 2.1.3 and report back.

@noubar
Copy link
Contributor

noubar commented Mar 6, 2024

Thank you for your hint
I will be giving you another hint stopping official support does not necessarily mean that it will not work.
I think newest version of this library still works with python 3.7 but we are not supporting it if some issue occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants