Всем привет!
Пробую сделать тест на мобилке, при помощи Appium и Java. Использую эмулятор Genymotion.
Собственно вот сам код:
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.net.URL;
import static org.junit.Assert.assertTrue;
public class MobileWebTest {
@Test
public void testIncorrectFBLogin() throws Exception {
URL serverUrl = new URL ("http://127.0.0.1:4723/wd/hub");
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9");
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "Google Pixel 3");
cap.setCapability(MobileCapabilityType.BROWSER_NAME, "Browser");
System.out.println("Step 1. Create new driver");
AppiumDriver driver = new AndroidDriver(serverUrl, cap);
WebDriverWait wait = new WebDriverWait(driver, 30);
System.out.println("Step 2. Open website");
driver.get("https://facebook.com");
System.out.println("Step 3. Enter email");
driver.findElement(By.name("email")).sendKeys("simon_86@mail.ru");
System.out.println("Step 4. Enter password");
driver.findElement(By.name("pass")).sendKeys("12345678");
System.out.println("Step 5. Click Login Button");
driver.findElement(By.name("Login")).click();
System.out.println("Step 6. Check error massage");
assertTrue(driver.findElement(By.cssSelector("div[data-sigil='m_login_notice']")).getText().contains("Неверный пароль. Вы забыли свой пароль?"));
System.out.println("Step 7. Close driver");
driver.quit();
}
}
По итогу после запуска теста получаю ошибку, ругается на 31 строчку выделил жирным.
Прикрепил логи файлами.
Подскажите что не так делаю?