2017-09-14 5 views
0

appiumがスピンクリック200ステータスコードを返すゲームアプリケーションに悩まされています(appiumは200コードを返しますが、ゲームページのクリックは機能しません)。 )が、デバイス上でクリックは実行されません。これはWebアプリケーションであり、私は実際のデバイスを使用しています。どんな助けでも大歓迎です。appiumはステータスコード200を返しますが、デバイス上でクリックは行われません

私は暗黙的で明示的な待機を使用しようとしましたが、スレッド、JavaScript、座標ベースのクリックを使用して待ちますが運はありません。

私は以下のコード使用しています:

public class AndriodDriver { 

AndroidDriver<WebElement> driver; 

@Test 
public void testFirstCalculator() throws IOException, InterruptedException { 
    DesiredCapabilities capabilities = new DesiredCapabilities(); 
    capabilities = new DesiredCapabilities(); 
    capabilities.setCapability("deviceName", "Samsung Galaxy S7"); 
    capabilities.setCapability("platformName", "Android"); 
    capabilities.setCapability(CapabilityType.BROWSER_NAME, "Chrome"); 
    capabilities.setCapability("platformVersion", "7.0"); 


    driver = new AndroidDriver<WebElement>(new 
    URL("http://0.0.0.0:4723/wd/hub"), capabilities); 
    driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); 

    driver.get("https://pa03-mob.wi-gameserver.com/resource-service/test- 
    lobby/index.html"); 
    driver.manage().timeouts().implicitlyWait(200, TimeUnit.SECONDS); 
    System.out.println("main url"); 

    driver.findElement(By.xpath(".//*[@id='Open Lobby with debug properties']")).click(); 
    System.out.println("lobby opened"); 

    driver.findElement(By.xpath(".//*[@id='brucelee']")).click(); 
    System.out.println("game loading"); 


    WebDriverWait wait= new WebDriverWait(driver, 30); 
    //wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(".//* 
    [@id='spin-button']"))); 
    Thread.sleep(3500); 
    driver.findElementByXPath(".//*[@id='spin-button']").click(); 

} 
} 

答えて

0

第1工程: 次の機能を追加してください:

 cap.setCapability("automationName","MyTest"); 

を第二段階:

 Please replace the line : 

     capabilities.setCapability(CapabilityType.BROWSER_NAME, "Chrome"); 

     by this: 
     cap.setCapability("browserName","Chrome"); 
+0

私はautomatonNameを追加しようとしたが、しかし、 appiumが以下のエラーを投げています: [Andr oidDriver] AndroidDriverバージョン:1.20.0 [BaseDriver] SessionNotCreatedError:新しいセッションを作成できませんでした。詳細:desiredCapabilitiesオブジェクトは、次の理由で有効ではありません:automationName MyTestは、AndroidDriver.validateDesiredCaps(C:\ Users \ name \ AppData \)にあるAndroidDriver.validateDesiredCapsのAppium、Selendroid、UiAutomator2、XCUITest、YouiEngine、 の一部ではありません。ローカル\プログラム\ appium-desktop \ resources \ app \ node_modules \ appium \ node_modules \ appium-base-driver \ lib \ basedriver \ driver.js:155:25) – user3134

関連する問題