assertj / assertj/assertj-swing

AssertJ not clicking boxes - Java 11

Open
#229 18 comments 0 reactions 0 assignees View on GitHub
Java11
Dominant language
Java
Stars
121
Forks
52
PR merge metrics
No merged PRs in 30d

Description

#### Summary
I’m not able to use basic click functionalities with AssertJ (basically everything related to activating buttons)

Opened a [thread](https://stackoverflow.com/questions/53379005/assertj-not-clicking-boxes) about it in STO as well -

I’m not sure if it’s a regression or if I’m just missing out something obvious… the example here - [Example](https://github.com/joel-costigliola/assertj-examples/blob/master/assertj-swing-junit-examples/src/test/java/org/assertj/swing/junit/examples/getting_started/SimpleCopyApplicationTest.java) is not working on my env as well (Java 11)

#### Example

The GUI is a JPanel and I use Containers.showInFrame to display it.

The panel has some text fields, JCheckboxes and JComboboxes.

I'm able to set text in the text fields, but I am not able to check/select the boxes. Been breaking my head but couldn't figure out what is missing...

Working:
```java
frame.textBox("example").setText(result).requireText(result);
```
Not working:
```java
frame.checkBox("exampleCheckBox").uncheck().requireNotSelected();
frame.checkBox("example2CheckBox").check().requireSelected();
panel.comboBox("exampleComboBox").selectItem(2);
```
The component description that I get for a checkbox is:

`[javax.swing.JCheckBox[name='exampleCheckBox', text='Mandatory', selected=true, enabled=true, visible=true, showing=true] - property:'selected']`

Using Java 11, Gradle build, latest assertj-swing-junit and assertj-core.

Would highly appreciate any leads!
Thank you

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.