Skip to content

Commit b7ac171

Browse files
authored
Merge pull request #2290 from RushilK7/stage
Stage
2 parents 480e99a + 46cb051 commit b7ac171

File tree

4 files changed

+556
-308
lines changed

4 files changed

+556
-308
lines changed

docs/smartui-appium-java-sdk.md

Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ keywords:
1717
- Mobile App Testing
1818
- App Visual Testing
1919

20-
url: https://www.lambdatest.com/support/docs/smartui-appium-java-sdk
20+
url: https://www.lambdatest.com/support/docs/smartui-appium-java-sdk
2121
slug: smartui-appium-java-sdk
2222

2323
---
@@ -133,10 +133,10 @@ public class YourTestClass {
133133
// Configure screenshot settings
134134
Map<String, String> ssConfig = new HashMap<>();
135135
// Either use environment variable
136-
ssConfig.put("projectToken", "your-project-token-here"); // Use this if you are not setting the project token in environment variable
137-
// ssConfig.put("buildName", "First Build"); // Optional
136+
ssConfig.put("projectToken", "your-project-token-here"); // Use this if you are not setting the project token in environment variable
137+
// ssConfig.put("buildName", "First Build"); // Optional
138138
ssConfig.put("deviceName", "iPhone 15"); // Required, you can use the variables that you are setting in the cloud capabilities
139-
139+
140140
ssConfig.put("platform", "iOS"); // Optional,you can use the variables that you are setting in the cloud capabilities
141141

142142
try {
@@ -147,16 +147,16 @@ public class YourTestClass {
147147
// Your test code here - Example of native app interactions
148148
driver.findElement(MobileBy.AccessibilityId("username-input")).sendKeys("[email protected]");
149149
driver.findElement(MobileBy.AccessibilityId("password-input")).sendKeys("password123");
150-
150+
151151
// Take screenshot of login form
152152
SmartUI.smartuiAppSnapshot(driver, "Login Form", ssConfig);
153-
153+
154154
driver.findElement(MobileBy.AccessibilityId("login-button")).click();
155-
155+
156156
// Wait for home screen to load
157157
WebDriverWait wait = new WebDriverWait(driver, 10);
158158
wait.until(ExpectedConditions.presenceOfElementLocated(MobileBy.AccessibilityId("home-screen")));
159-
159+
160160
// Take screenshot of home screen
161161
SmartUI.smartuiAppSnapshot(driver, "Home Screen", ssConfig);
162162

@@ -199,7 +199,7 @@ ssConfig.put("platform", "iOS");
199199
```
200200

201201
#### Important Notes:
202-
- It is advised to use the same `deviceName` and `platform` combination across builds to compare screenshots of the same device
202+
- It is advised to use the same `deviceName` and `platform` combination across builds to compare screenshots of the same device
203203
- These parameters are metadata tags and don't affect the actual device selection on your cloud provider
204204

205205
Example configurations for different cloud providers:
@@ -368,7 +368,10 @@ SmartUISnapshot.smartuiSnapshot(driver, "Screen Loaded");
368368
- Use meaningful build names
369369
- Run tests on consistent device configurations
370370

371-
**Troubleshooting**
371+
</TabItem>
372+
</Tabs>
373+
374+
## Troubleshooting
372375

373376
<Tabs className='docs__val' groupId='troubleshooting'>
374377
<TabItem value='screenshots-not-captured' label='Screenshots Not Captured' default>
@@ -407,7 +410,7 @@ SmartUISnapshot.smartuiSnapshot(driver, "Screen Loaded");
407410
</TabItem>
408411
<TabItem value='project-not-found-error' label='Project Not Found Error'>
409412

410-
**Issue: Project Not Found" Error**
413+
**Issue: Project Not Found Error**
411414

412415
**Symptoms**: Error indicating SmartUI project cannot be found
413416

@@ -440,7 +443,7 @@ SmartUISnapshot.smartuiSnapshot(driver, "Screen Loaded");
440443
1. Add explicit waits before screenshots:
441444
```java
442445
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
443-
wait.until(ExpectedConditions.presenceOfElementLocated(By.id(content")));
446+
wait.until(ExpectedConditions.presenceOfElementLocated(By.id("content")));
444447
```
445448

446449
2. Wait for specific elements to be visible:
@@ -469,8 +472,8 @@ SmartUISnapshot.smartuiSnapshot(driver, "Screen Loaded");
469472
2. Ensure elements exist at screenshot time
470473
3. Check JSON formatting in configuration:
471474
```java
472-
Map<String, Object"> ignoreBoxes = new HashMap<">();
473-
ignoreBoxes.put(xpath", new String[]{"//*[@text="'Dynamic" Ad']"});
475+
Map<String, Object> ignoreBoxes = new HashMap<>();
476+
ignoreBoxes.put("xpath", new String[]{"//*[@text='Dynamic Ad']"});
474477
```
475478

476479
4. Test XPath locators in isolation before using in config
@@ -501,7 +504,7 @@ SmartUISnapshot.smartuiSnapshot(driver, "Screen Loaded");
501504

502505
**Issue: Screenshot Names Not Matching Baseline**
503506

504-
**Symptoms**: Screenshots appear as New" instead of comparing with baseline
507+
**Symptoms**: Screenshots appear as New instead of comparing with baseline
505508

506509
**Possible Causes**:
507510
- Screenshot name changed
@@ -514,16 +517,6 @@ SmartUISnapshot.smartuiSnapshot(driver, "Screen Loaded");
514517
3. Avoid special characters in screenshot names
515518
4. Check for case sensitivity issues
516519

517-
**Getting Help**
518-
519-
If you encounter issues not covered here:
520-
521-
- Review the [Comprehensive Troubleshooting Guide](/support/docs/smartui-troubleshooting-guide) for detailed solutions
522-
- Check [SmartUI Configuration Options](/support/docs/smartui-sdk-config-options) documentation
523-
- See [Handling Dynamic Data](/support/docs/smartui-handle-dynamic-data) for dynamic content issues
524-
- Visit [LambdaTest Support](https://www.lambdatest.com/support) for additional resources
525-
- Contact support at [email protected] or use [24/7 Chat Support](https://www.lambdatest.com/support)
526-
527520
</TabItem>
528521
</Tabs>
529522

@@ -537,27 +530,6 @@ If you encounter issues not covered here:
537530
- [Appium Hooks Documentation](/support/docs/smartui-appium-hooks)
538531
- [SmartUI API Documentation](https://www.lambdatest.com/support/api-doc/)
539532

540-
<nav aria-label='breadcrumbs'>
541-
<ul className='breadcrumbs'>
542-
<li className='breadcrumbs__item'>
543-
<a className='breadcrumbs__link' target="_self" href="https://www.lambdatest.com">
544-
Home
545-
</a>
546-
</li>
547-
<li className='breadcrumbs__item'>
548-
<a className='breadcrumbs__link' target="_self" href="https://www.lambdatest.com/support/docs/">
549-
Support
550-
</a>
551-
</li>
552-
<li className='breadcrumbs__item breadcrumbs__item--active'>
553-
<span className='breadcrumbs__link'> SmartUI Appium Java SDK </span>
554-
</li>
555-
</ul>
556-
</nav>
557-
558-
</TabItem>
559-
</Tabs>
560-
561533
<nav aria-label='breadcrumbs'>
562534
<ul className='breadcrumbs'>
563535
<li className='breadcrumbs__item'>

0 commit comments

Comments
 (0)