0

実際のデバイスで Chrome ブラウザを起動できません。エラーが見つかりました:

-Appium コマンドの実行エラー: path.resolve への引数は文字列でなければなりません

助けてください

15) [オブジェクト オブジェクト] で。(C:\Program Files\Appium\node_modules\appium\lib\appium.js:118:10) [object Object].Appium.start (C:\Program Files\Appium\node_modules\appium\lib\appium.js) :129:5) exports.createSession (C:\Program Files\Appium\node_modules\appium\lib\server\controller.js:188:16) で Layer.handle [as handle_request] (C:\Program Files\Appium) \node_modules\appium\node_modules\express\lib\router\layer.js:82:5) 次の (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110: 13) Route.dispatch (C:\Program Files\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3) で Layer.handle [as handle_request] (C:\Program Files\ Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5) C:

4

2 に答える 2

1

問題を解決するには、次のコードを参照してください

AppiumDriver driver;
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "Android");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Chrome");
capabilities.setCapability("platformVersion", "5.0.2");
capabilities.setCapability("appPackage", "com.android.chrome");
capabilities.setCapability("appActivity","com.google.android.apps.chrome.ChromeTabbedActivity");
driver= new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.get("http://google.com");
于 2016-08-23T07:39:25.410 に答える
0

@Narendra Singh - 以下の解決策が機能するはずです -

private AndroidDriver driver;
public static String baseurl;

@Before
public void setup() throws MalformedURLException
{
    System.out.println("Create driver and launch Chrome");
    DesiredCapabilities capabilities = new DesiredCapabilities ();
    capabilities.setCapability("browsername","chrome");
    capabilities.setCapability("device","android");
    capabilities.setCapability("devicename","OssCube");
    capabilities.setCapability("platformversion","4.4.2");
    capabilities.setCapability("platformname","Android");
    capabilities.setCapability("appPackage","com.android.chrome");
   capabilities.setCapability("appActivity","com.google.android.apps.chrome.Main");
    driver=new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    baseurl = "https://www.google.com";
    driver.get(baseurl);
    }

どのようにテストを実行しますか?

于 2016-08-23T14:36:08.050 に答える