• 已提交

  • json配置

    {
    "platformName": "Android",
    "deviceName": "192.168.221.101:5555",
    "appPackage": "com.xueqiu.android",
    "appActivity": ".common.account.LoginOptionActivity"
    }

    Python脚本

    from appium import webdriver

    caps = {}
    caps["appPackage"] = "com.xueqiu.android"
    caps["appActivity"] = ".common.account.LoginOptionActivity"
    caps["deviceName"] = "xx"
    caps["platformName"] = "Android"

    driver = webdriver.Remote("http://localhost:4723/wd/hub", caps)

    el3 = driver.find_element_by_id("com.xueqiu.android:id/rl_login_by_wx")
    el3.click()

    driver.quit()

    java脚本

    import io.appium.java_client.MobileElement;
    import io.appium.java_client.android.AndroidDriver;
    import junit.framework.TestCase;
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import java.net.MalformedURLException;
    import java.net.URL;
    import org.openqa.selenium.remote.DesiredCapabilities;

    public class SampleTest {

    private AndroidDriver driver;

    @Before
    public void setUp() throws MalformedURLException {
    DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
    desiredCapabilities.setCapability("appPackage", "com.xueqiu.android");
    desiredCapabilities.setCapability("appActivity", ".common.account.LoginOptionActivity");
    desiredCapabilities.setCapability("deviceName", "xx");
    desiredCapabilities.setCapability("platformName", "Android");

    URL remoteUrl = new URL("http://localhost:4723/wd/hub");

    driver = new AndroidDriver(remoteUrl, desiredCapabilities);
    }

    @Test
    public void sampleTest() {
    MobileElement el3 = (MobileElement) driver.findElementById("com.xueqiu.android:id/rl_login_by_wx");
    el3.click();
    }

    @After
    public void tearDown() {
    driver.quit();
    }
    }

  • 执行结果

  • 没有邮箱

  • 简历已发