Created
May 12, 2020 20:37
-
-
Save mireshsonkamble/b0264fedf42166cfe53514cf6cf77dff 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
| package BStackTest; | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.net.MalformedURLException; | |
| import java.net.URL; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Set; | |
| import java.util.concurrent.TimeUnit; | |
| import org.apache.commons.io.FileUtils; | |
| import org.apache.tools.ant.types.resources.comparators.Date; | |
| import org.openqa.selenium.By; | |
| import org.openqa.selenium.Capabilities; | |
| import org.openqa.selenium.Dimension; | |
| import org.openqa.selenium.JavascriptExecutor; | |
| import org.openqa.selenium.OutputType; | |
| import org.openqa.selenium.TakesScreenshot; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.WebElement; | |
| import org.openqa.selenium.chrome.ChromeOptions; | |
| import org.openqa.selenium.interactions.Actions; | |
| import org.openqa.selenium.remote.Augmenter; | |
| import org.openqa.selenium.remote.DesiredCapabilities; | |
| import org.openqa.selenium.remote.RemoteWebDriver; | |
| import org.openqa.selenium.support.ui.WebDriverWait; | |
| import io.appium.java_client.android.AndroidDriver; | |
| import io.appium.java_client.android.AndroidElement; | |
| public class Query244794 { | |
| public static String userName = "<USERNAME>"; | |
| public static String accessKey = "<ACCESSKEY>"; | |
| public static final String URL = "https://" + userName + ":" + accessKey + "@hub-cloud.browserstack.com/wd/hub"; | |
| public static void main(String[] args) throws IOException, InterruptedException { | |
| DesiredCapabilities caps = new DesiredCapabilities(); | |
| caps.setCapability("os", "Windows"); | |
| caps.setCapability("os_version", "10"); | |
| caps.setCapability("browser", "Chrome"); | |
| caps.setCapability("browser_version", "80.0"); | |
| caps.setCapability("browserstack.local", "false"); | |
| caps.setCapability("browserstack.debug", "true"); | |
| caps.setCapability("browserstack.networkLogs", "true"); | |
| caps.setCapability("build", "BSSupport_M"); | |
| caps.setCapability("browserstack.selenium_version", "4.0.0-alpha-2"); | |
| caps.setCapability("resolution", "1920x1080"); | |
| WebDriver driver = new RemoteWebDriver(new URL(URL), caps); | |
| driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); | |
| driver.get("https://outlook.office365.com/"); | |
| WebElement element = driver.findElement(By.id("i0116")); | |
| element.isEnabled(); | |
| element = driver.findElement(By.id("i0116")); | |
| element.isDisplayed(); | |
| element = driver.findElement(By.id("i0116")); | |
| element.sendKeys("qa@cytoradevs.onmicrosoft.com"); | |
| element = driver.findElement(By.id("idSIButton9")); | |
| element.isEnabled(); | |
| element = driver.findElement(By.id("idSIButton9")); | |
| element.click(); | |
| Thread.sleep(5000); | |
| element = driver.findElement(By.id("i0118")); | |
| element.isDisplayed(); | |
| element = driver.findElement(By.id("i0118")); | |
| element.click(); | |
| element = driver.findElement(By.id("i0118")); | |
| element.sendKeys("Acumen1994"); | |
| element =driver.findElement(By.id("idSIButton9")); | |
| element.isEnabled(); | |
| element.click(); | |
| System.out.println(driver.getCurrentUrl()); | |
| Thread.sleep(5000); | |
| System.out.println(driver.getTitle()); | |
| Thread.sleep(5000); | |
| element =driver.findElement(By.id("idBtn_Back")); | |
| element.isEnabled(); | |
| element.click(); | |
| Thread.sleep(5000); | |
| System.out.println(driver.getTitle()); | |
| Thread.sleep(5000); | |
| driver.quit(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment