Skip to content

updated readme for java sdk #23

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

Merged
merged 5 commits into from
Mar 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,63 @@
# smartui-sdk-utils
# LambdaTest Java SDK

Run the following command to install the dependencies of the project mentioned in `pom.xml`:

```sh
mvn clean install
```

Set the required environment variables:

```sh
export PROJECT_TOKEN=<add-your-project-token>
export LT_ACCESS_KEY=<add-your-access-key>
export LT_USERNAME=<add-your-username>
```

## Usage

### To Take SmartUI App Snapshot
`import io.github.lambdatest.SmartUIAppSnapshot;`
#### 1. Create an Object of `SmartUIAppSnapshot`

```java
SmartUIAppSnapshot smartUIAppSnapshot = new SmartUIAppSnapshot();
Map<String, String> screenshotConfig = new HashMap<>();
screenshotConfig.put("deviceName","Google pixel 9");
screenshotConfig.put("platform","Android 15");

smartUIAppSnapshot.start();
smartUIAppSnapshot.smartuiAppSnapshot(driver, "screenshot1", screenshotConfig);
smartUIAppSnapshot.stop();

```


### To Take SmartUI Snapshot

#### 1. Install the `smartui-cli` Dependencies

```sh
npm i @lambdatest/smartui-cli
```

#### 2. Create and Configure SmartUI Config

```sh
npx smartui config:create smartui-web.json
```
```java
import io.github.lambdatest.SmartUISnapshot;

public class SmartUISDK {

private RemoteWebDriver driver;

@Test
public void basicTest() throws Exception {
driver.get("https://www.lambdatest.com/support/docs/smartui-selenium-java-sdk");
SmartUISnapshot.smartuiSnapshot(driver, "visual-regression-testing");
}

}
```