Skip to content

Commit 15c4e05

Browse files
committed
added w3c capabilities
1 parent c1b2e32 commit 15c4e05

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

src/test/java/ios/BrowserStackSample.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,50 @@
1616
public class BrowserStackSample {
1717

1818
public static void main(String[] args) throws MalformedURLException, InterruptedException {
19-
DesiredCapabilities caps = new DesiredCapabilities();
20-
21-
// Set your access credentials
22-
caps.setCapability("browserstack.user", "YOUR_USERNAME");
23-
caps.setCapability("browserstack.key", "YOUR_ACCESS_KEY");
19+
20+
DesiredCapabilities caps = new DesiredCapabilities();
21+
22+
// Set your access credentials
23+
caps.setCapability("browserstack.user", "YOUR_USERNAME");
24+
caps.setCapability("browserstack.key", "YOUR_ACCESS_KEY");
2425

2526
// Set URL of the application under test
2627
caps.setCapability("app", "bs://<app-id>");
27-
28-
// Specify device and os_version for testing
29-
caps.setCapability("device", "iPhone 11 Pro");
30-
caps.setCapability("os_version", "13");
3128

32-
// Set other BrowserStack capabilities
33-
caps.setCapability("project", "First Java Project");
34-
caps.setCapability("build", "browserstack-build-1");
35-
caps.setCapability("name", "first_test");
36-
37-
38-
// Initialise the remote Webdriver using BrowserStack remote URL
39-
// and desired capabilities defined above
29+
// Specify device and os_version for testing
30+
caps.setCapability("deviceName", "iPhone 11 Pro");
31+
caps.setCapability("platformName", "ios");
32+
caps.setCapability("platformVersion", "13");
33+
34+
// Set other BrowserStack capabilities
35+
caps.setCapability("project", "First Java Project");
36+
caps.setCapability("build", "browserstack-build-1");
37+
caps.setCapability("name", "first_test");
38+
39+
// Initialise the remote Webdriver using BrowserStack remote URL
40+
// and desired capabilities defined above
4041
RemoteWebDriver driver = new RemoteWebDriver(
41-
new URL("http://hub-cloud.browserstack.com/wd/hub"), caps);
42+
new URL("http://hub-cloud.browserstack.com/wd/hub"), caps);
4243

43-
4444
// Test case for the BrowserStack sample iOS app.
4545
// If you have uploaded your app, update the test case here.
4646
WebElement textButton = (WebElement) new WebDriverWait(driver, 30).until(
4747
ExpectedConditions.elementToBeClickable(AppiumBy.accessibilityId("Text Button")));
4848
textButton.click();
49+
4950
WebElement textInput = (WebElement) new WebDriverWait(driver, 30).until(
5051
ExpectedConditions.elementToBeClickable(AppiumBy.accessibilityId("Text Input")));
5152
textInput.sendKeys("hello@browserstack.com");
5253
Thread.sleep(5000);
54+
5355
WebElement textOutput = (WebElement) new WebDriverWait(driver, 30).until(
5456
ExpectedConditions.elementToBeClickable(AppiumBy.accessibilityId("Text Output")));
5557
if(textOutput != null && textOutput.getText().equals("hello@browserstack.com"))
5658
assert(true);
5759
else
5860
assert(false);
59-
61+
6062
// Invoke driver.quit() after the test is done to indicate that the test is completed.
6163
driver.quit();
62-
63-
}
64-
64+
}
6565
}

0 commit comments

Comments
 (0)