assertj / assertj/assertj-swing

FrameFixture.robot.click(target) and robot.click(FrameFixture.target) do not act the same, nor at the same speed

Open
#124 0 comments 0 reactions 0 assignees View on GitHub
bug import from fest-swing Minor
Dominant language
Java
Stars
121
Forks
52
PR merge metrics
No merged PRs in 30d

Description

_Issue by **[Teague Bick](http://jira.codehaus.org/secure/ViewProfile.jspa?name=tabgok)** from Wed, 9 Feb 2011 13:50:02 -0600_
_Originally opened as http://jira.codehaus.org/browse/FEST-428_

---

window.robot.click(...), for example:

window.robot.click(window.menuItem("File Menu").target);

window.robot.click(window.menuItem("Open Project").target);

is so much faster than (window.component(...).click), for example:

window.menuItem("File Menu").click();

window.menuItem("Open Project").click();

In addition, they suffer from slightly different functionality. I placed both methods in a loop to click a menu item 50 times:

for(int i=0;i<50;i++){

robot.click( window.menuItem(new GenericTypeMatcher<JMenu>(JMenu.class){

protected boolean isMatching(JMenu item)

{
return "File".equals(item.getText());
}

}).target);

}



for(int i=0;i<50;i++){

window.menuItem(new GenericTypeMatcher<JMenu>(JMenu.class){

protected boolean isMatching(JMenu item){
return "File".equals(item.getText());
}

}).click();

}

The first loop is faster and will repeatedly open / close the "File" menu, while the second loop is slower and freezes after selecting the MenuItem twice.

---

votes (original issue): 0
watches (original issue): 0

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.