2016-03-30 5 views
-2

Ich habe eine Assertion hinzugefügt, während der Code die Schaltfläche nicht finden kann, aber Im getting Timeout Ausnahme.Wie kann ich das lösen?Android Selen Timeout

Boolean buton=getElement(By.className("android.widget.Button")).isDisplayed();   System.out.println("İzle butonlarının görülme durumu="+buton); 
      Assert.assertTrue("İzle butonu ekranda görülmedi!!.",buton); 
     clickAndWaitForElement(By.className("android.widget.Button")); 

Antwort

1

wirdangezeigt()

selbst Booleschen Wert zurückgibt, ändern Sie es zu

WebElement buton=driver.findElement(By.className("android.widget.Button")) 
if(button.isDisplayed()) { 
     System.out.println("İzle butonlarının görülme durumu="+buton); 
} 
else{ 
      Assert.assertTrue("İzle butonu ekranda görülmedi!!.",buton); } 
    ...... 
+1

Ja, ich hatte sich verändert wie this.it funktioniert: List buton = Treiber. findElementById ("com.digiturk.iq.mobil: id/productDetailContainer"). findElements (By.className ("android.widget.Button")); \t \t Assert.assertTrue ("İzle butonu ekranda görülmedi !!.", Buton.size()> 0); – little