Skip to content

Commit 67d2c1f

Browse files
committed
refactored as per review comment
1 parent 47f80ad commit 67d2c1f

File tree

1 file changed

+10
-27
lines changed

1 file changed

+10
-27
lines changed

README.md

+10-27
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,24 @@ export LT_USERNAME=<add-your-username>
1717

1818
## Usage
1919

20-
### Using the App Screenshot Function
21-
20+
### To Take Smartui App Snapshot
21+
`import io.github.lambdatest.SmartUIAppSnapshot;`
2222
#### 1. Create an Object of `SmartUIAppSnapshot`
2323

2424
```java
25-
import java.util.HashMap;
26-
import java.util.Map;
27-
28-
public class SmartUITest {
29-
public static void main(String[] args) {
25+
SmartUIAppSnapshot smartUIAppSnapshot = new SmartUIAppSnapshot();
3026
Map<String, String> screenshotConfig = new HashMap<>();
31-
screenshotConfig.put("deviceName", "Google Pixel 9");
32-
screenshotConfig.put("platform", "Android 15");
27+
screenshotConfig.put("deviceName","Google pixel 9");
28+
screenshotConfig.put("platform","Android 15");
3329

34-
SmartUIAppSnapshot smartUIAppSnapshot = new SmartUIAppSnapshot();
35-
36-
try {
37-
smartUIAppSnapshot.start(); // Start authentication and create the build
38-
smartUIAppSnapshot.smartuiAppSnapshot(driver, "screenshot1", screenshotConfig); // Capture screenshot
39-
} catch (Exception e) {
40-
System.err.println("Error capturing SmartUI snapshot: " + e.getMessage());
41-
e.printStackTrace();
42-
} finally {
43-
try {
44-
smartUIAppSnapshot.stop(); // Ensure stop is always called
45-
} catch (Exception ex) {
46-
System.err.println("Error stopping SmartUI session: " + ex.getMessage());
47-
}
48-
}
49-
}
50-
}
30+
smartUIAppSnapshot.start();
31+
smartUIAppSnapshot.smartuiAppSnapshot(driver, "screenshot1", screenshotConfig);
32+
smartUIAppSnapshot.stop();
33+
5134
```
5235

5336

54-
### Using the Web Screenshot Function
37+
### To Take Smartui Snapshot
5538

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

0 commit comments

Comments
 (0)