appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.21k stars 755 forks source link

org.openqa.selenium.remote.http.HttpClient.execute(Lorg/openqa/selenium/remote/http/HttpRequest;Z)Lorg/openqa/selenium/remote/http/HttpResponse; #1135

Open solaiyappan123mca opened 5 years ago

solaiyappan123mca commented 5 years ago

at io.appium.java_client.remote.AppiumProtocolHandShake.createSession(AppiumProtocolHandShake.java:114) at io.appium.java_client.remote.AppiumProtocolHandShake.createSession(AppiumProtocolHandShake.java:76) at io.appium.java_client.remote.AppiumCommandExecutor.doExecute(AppiumCommandExecutor.java:111) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:162) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131) at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:88) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:112) at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:73) at com.example.appapplication.Iosampletest.setup(Iosampletest.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215) at org.testng.internal.Invoker.invokeMethod(Invoker.java:589) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:782) at org.testng.TestRunner.run(TestRunner.java:632) at org.testng.SuiteRunner.runTest(SuiteRunner.java:366) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319) at org.testng.SuiteRunner.run(SuiteRunner.java:268) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244) at org.testng.TestNG.runSuitesLocally(TestNG.java:1169) at org.testng.TestNG.run(TestNG.java:1064) at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72) at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)

Test ignored.

=============================================== Default Suite Total tests run: 1, Failures: 0, Skips: 1 Configuration Failures: 1, Skips: 1

Process finished with exit code 0

solaiyappan123mca commented 5 years ago

my code is

package com.example.appapplication;

import io.appium.java_client.MobileElement; import io.appium.java_client.android.AndroidDriver; import org.openqa.selenium.By; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test;

import java.net.MalformedURLException; import java.net.URL;

public class Iosampletest {

public AndroidDriver<MobileElement> driver;
public WebDriverWait wait;

//Elements

// String secondNewJob = "//android.widget.FrameLayout[2]/android.widget.LinearLayout/" + // "android.widget.RelativeLayout/android.widget.ImageView";

@BeforeMethod
public void setup () throws MalformedURLException {
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("deviceName", "2936c8900304");
   // caps.setCapability("udid", "emulator-5554"); //DeviceId from "adb devices" command
    caps.setCapability("platformName", "Android");
    caps.setCapability("platformVersion", "7.0");
    caps.setCapability("skipUnlock","true");
    caps.setCapability("appPackage", "com.finobot.finobot");
    caps.setCapability("appActivity","com.finobot.finobot.activity.LoginandSignUpActivity");
    caps.setCapability("noReset","false");
    driver = new AndroidDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"),caps);
    wait = new WebDriverWait(driver, 10);
}

@Test
public void basicTest () throws InterruptedException {
    //Click and pass Splash
    wait.until(ExpectedConditions.visibilityOfElementLocated
            (By.id("android.widget.EditText"))).click();

    //Click I am searching a job
   // wait.until(ExpectedConditions.visibilityOfElementLocated
           // (By.id("com.isinolsun.app:id/bluecollar_type_button"))).click();

    //Notification Allow
    if (driver.findElements(By.id("com.android.packageinstaller:id/permission_allow_button")).size()>0) {
        driver.findElements(By.id("com.android.packageinstaller:id/permission_allow_button")).get(0).click();
    }

   // wait.until(ExpectedConditions.visibilityOfElementLocated
        //    (By.xpath(secondNewJob)));
}

@AfterMethod
public void teardown(){
    driver.quit();
}

}