Upgrading to Latest Brobot
Philosophy: Brobot is in active development and prioritizes clean, maintainable code over backward compatibility. See CLAUDE.md in the repository root for development philosophy.
Current Recommended Approachโ
For new projects: Follow the Quick Start Guide
For existing projects: We recommend using the current patterns rather than maintaining old code:
Key Current Patternsโ
1. Use ActionConfig (not ActionOptions)โ
Modern approach:
import io.github.jspinak.brobot.actions.composites.methods.find.PatternFindOptions;
import io.github.jspinak.brobot.actions.composites.methods.click.ClickOptions;
// Specialized config classes for each action type
PatternFindOptions findOptions = new PatternFindOptions.Builder()
.withMinSimilarity(0.85)
.withMaxWait(5.0)
.build();
ClickOptions clickOptions = new ClickOptions.Builder()
.withMaxClicks(3)
.withClickUntil(ClickUntil.OBJECTS_VANISH)
.build();
2. Use @State and @Transition Annotationsโ
Modern approach:
@State
public class LoginState {
@StateImage
private StateImage loginButton;
@StateImage
private StateImage usernameField;
}
@Transition
public class LoginTransitions {
@OutgoingTransition
public void clickLogin(Action action) {
action.click(loginState.getLoginButton());
}
}
See: States Guide
3. Use Action Class Methodsโ
Modern approach:
@Autowired
private Action action;
public void performLogin() {
action.click(loginButton);
action.type(usernameField, "username");
action.type(passwordField, "password");
action.click(submitButton);
}
See: Basic Actions API Reference
If You Have Old Codeโ
Option 1: Fresh Start (Recommended)โ
- Start with current patterns from documentation
- Copy business logic, not old API calls
- Use modern ActionConfig system
- Much faster than migrating line-by-line
Option 2: Incremental Updateโ
- Update dependencies to latest Brobot version
- Fix compilation errors by referencing current documentation
- Replace old patterns with current equivalents
- Test thoroughly
Common Pattern Updatesโ
Finding Objectsโ
// Use specialized PatternFindOptions
PatternFindOptions options = new PatternFindOptions.Builder()
.withMinSimilarity(0.85)
.build();
ActionResult result = action.find(options, targetImage);
Clickingโ
// Use specialized ClickOptions
ClickOptions options = new ClickOptions.Builder()
.withClickUntil(ClickUntil.OBJECTS_VANISH)
.build();
ActionResult result = action.click(options, button);
Typingโ
// Use specialized TypeOptions
TypeOptions options = new TypeOptions.Builder()
.withClearFieldFirst(true)
.build();
action.type(options, inputField, "text");
Getting Helpโ
- Documentation: Start with Getting Started
- API Reference: See Basic Actions API
- Examples: Check Tutorials
- Testing: See Testing Guide
Historical Migration Guidesโ
If you specifically need old version migration information, see /archive/migration-guides-historical/ in the repository. However, we recommend using current patterns instead of maintaining old code.
Version Informationโ
Current Version: See repository version Upgrade Frequency: Brobot is actively developed with frequent updates Breaking Changes: Expected - project prioritizes clean code over backward compatibility
Philosophyโ
From CLAUDE.md:
This library is in active development. We prioritize clean, maintainable code over backward compatibility.
Key Principles:
- No Backward Compatibility Burden - remove old code paths entirely when refactoring
- Single Source of Truth - one property, one configuration, one way to do things
- Clean Refactoring - update all references immediately when changing APIs
- No Deprecation Warnings - just make the change and update all affected code
- Simplicity First - remove complexity, don't add compatibility layers
This approach keeps the codebase clean, reduces technical debt, and makes the library easier to understand and maintain.