Created
August 19, 2021 11:07
-
-
Save Jaimin180296/07ca777cf7c3cba761c95c8ab9cc3f69 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.URL; | |
import java.net.MalformedURLException; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import io.appium.java_client.ios.IOSDriver; | |
import io.appium.java_client.ios.IOSElement; | |
public class UseFindBy { | |
static IOSDriver<IOSElement> driver; | |
static FindBy findBy; | |
public static void main(String[] args) throws MalformedURLException, InterruptedException { | |
DesiredCapabilities caps = new DesiredCapabilities(); | |
// Set your access credentials | |
caps.setCapability("browserstack.user", "<username>"); | |
caps.setCapability("browserstack.key", "<key>"); | |
// Set URL of the application under test | |
caps.setCapability("app", "bs://444bd0308813ae0dc236f8cd461c02d3afa7901d"); | |
// Specify device and os_version for testing | |
caps.setCapability("device", "iPhone XS"); | |
caps.setCapability("os_version", "12"); | |
// Set other BrowserStack capabilities | |
caps.setCapability("project", "First Java Project"); | |
caps.setCapability("build", "Java iOS"); | |
caps.setCapability("name", "first_test"); | |
// Initialise the remote Webdriver using BrowserStack remote URL | |
// and desired capabilities defined above | |
driver = new IOSDriver<IOSElement>( | |
new URL("http://hub-cloud.browserstack.com/wd/hub"), caps); | |
Thread.sleep(500); | |
findBy = new FindBy(driver); | |
findBy.setLogin_btn(); | |
driver.quit(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment