<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                appuim環境搭建 1下載安裝并配置jdk ``` JAVA_HOME=C:\Program Files\Java\jdk1.8.0_271 path=%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar ``` 2下載安裝idea 3下載并配置sdk環境變量 ![](https://img.kancloud.cn/6e/b6/6eb6f5d2fd7e3ecbafd0c55f6878ebd2_1145x3000.png) ``` ANDROID_HOME=F:\softTest\tools\appuim\android-sdk_r24 PATH=;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools; ``` 4 下載安裝夜神模擬器 5 把sdk中的adb命令替換到夜神模擬器中 6 在idea中創建項目,完善項目資源及代碼 ``` ~~~ package com; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.android.AndroidElement; public class AppuimTest { private static AndroidDriver<AndroidElement> driver; public static void init() { // 獲取當前程序的路徑 File classpathRoot = new File(System.getProperty("user.dir")); // 獲取apps文件 File appDir = new File(classpathRoot, "apps"); // 獲取apk文件 File app = new File(appDir, "ContactManager.apk"); // 包裝數據發送給appium-servier DesiredCapabilities capabilities = new DesiredCapabilities(); // 啟動的設備名稱 capabilities.setCapability("device", "127.0.0.1:62001");// 夜神模擬器名稱 // 系統平臺名稱 capabilities.setCapability("PLATFORM", "Android"); // 系統平臺版本 capabilities.setCapability("platformVersion", "7.1.2"); // app的絕對路徑 capabilities.setCapability("app", app.getAbsolutePath()); // app的包名 // capabilities.setCapability("appPackage", "com.example.android.contactmanager"); // app的入口啟動activity capabilities.setCapability("appActivity", ".ContactManager"); // 連接appium啟動相應app try { driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); } catch (MalformedURLException e) { e.printStackTrace(); } System.out.println("App is launched!");// } public static void start() throws InterruptedException { Thread.sleep(100); // 找到相應元素 WebElement el = driver.findElement(By.name("Add Contact")); el.click();// 模擬點擊 // 找到eidit控件 List<AndroidElement> textFieldsList = driver.findElementsByClassName("android.widget.EditText"); // 為第一個edit控件設置值 textFieldsList.get(0).sendKeys("Some Name"); Thread.sleep(100); WebElement spin = driver.findElement(By.id("com.example.android.contactmanager:id/contactPhoneTypeSpinner")); spin.click(); Thread.sleep(100); WebElement t = driver.findElement(By.name("手機")); t.click(); Thread.sleep(100); // 為第三個edit控件設置值 textFieldsList.get(2).sendKeys("Some@example.com"); Thread.sleep(500); WebElement spin2 = driver.findElement(By.id("com.example.android.contactmanager:id/contactEmailTypeSpinner")); spin2.click(); Thread.sleep(500); WebElement tt = driver.findElement(By.name("其他")); System.out.println(); tt.click(); Thread.sleep(100); System.out.println("App is done!"); } public static void end() { // 關閉子窗口 driver.quit(); } public static void main(String[] args) throws InterruptedException{ System.out.println("-----"); init(); Thread.sleep(3000); end(); } } ~~~ ``` 7 測試運行腳本
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看