Upgrading an Existing Project to SHAFT
Already have a Selenium, Appium, or REST Assured project? You can add SHAFT incrementally — no need to rewrite your tests.
Step 1: Add the SHAFT Dependency
Add the following to your pom.xml:
<dependency>
<groupId>io.github.shafthq</groupId>
<artifactId>SHAFT_ENGINE</artifactId>
<!-- Replace with the latest version from Maven Central -->
<version>RELEASE</version>
</dependency>
info
Check Maven Central for the latest SHAFT version.
Step 2: Start Using SHAFT Drivers
Replace native driver initialization with SHAFT drivers:
// Before — native Selenium
WebDriver driver = new ChromeDriver();
// After — SHAFT (browser type configured via properties)
SHAFT.GUI.WebDriver driver = new SHAFT.GUI.WebDriver();
Your existing By locators and test logic remain unchanged.
Step 3: Leverage SHAFT Features Incrementally
You don't need to migrate everything at once. Start with:
- Replace driver init — Let SHAFT manage browser/driver lifecycle
- Use built-in waits — Remove explicit
WebDriverWaitcalls - Add validations — Use
driver.assertThat()for built-in assertions with reporting - Externalize config — Move hard-coded values to properties files
Full Migration Guide
For detailed migration steps, see the complete migration guide on GitHub.