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

Duplicate JPopupMenuFixture, macOs, v0.11.7 #114

Open
bric3 opened this issue Oct 21, 2021 · 0 comments
Open

Duplicate JPopupMenuFixture, macOs, v0.11.7 #114

bric3 opened this issue Oct 21, 2021 · 0 comments
Assignees

Comments

@bric3
Copy link

bric3 commented Oct 21, 2021

Hey I came across, what I think is a bug when rewriting a query to access a menu form the main menu bar.

In order to be able to use script the menu bar I had to pass this system property (apple.laf.useScreenMenuBar=false) as mentioned in my comment #17 (comment)

I wrote this code

robot.find(byXpath("//div[@text='${path[0]}']//div[@text='${path[1]}']"))

And when replacing it with JPopupMenuFixture, the find method failed because two fixtures of the same menu showed up.

To workaround this I replaced find by findAll and taking the first item.

attempt(tries = 3) {
    menuBar.select(path[0])
}

return robot.findAll<JPopupMenuFixture>(JPopupMenuFixture.byContainsItem(path[1]))
    .map { it.menuItem(path[1]) }
    .firstOrNull() // select the first item
@nizienko nizienko self-assigned this Nov 12, 2021
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