@@ -17,41 +17,24 @@ export LT_USERNAME=<add-your-username>
17
17
18
18
## Usage
19
19
20
- ### Using the App Screenshot Function
21
-
20
+ ### To Take Smartui App Snapshot
21
+ ` import io.github.lambdatest.SmartUIAppSnapshot; `
22
22
#### 1. Create an Object of ` SmartUIAppSnapshot `
23
23
24
24
``` 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 ();
30
26
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" );
33
29
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
+
51
34
```
52
35
53
36
54
- ### Using the Web Screenshot Function
37
+ ### To Take Smartui Snapshot
55
38
56
39
#### 1. Install the ` smartui-cli ` Dependencies
57
40
0 commit comments