0
我試圖執行一個testcase登錄頁面flipkart應用程序在Android設備上使用appium。等待存在的元素在30秒後超時位於:By.id:
我正在不一致誤差如下: By.id:com.flipkart.android:id/et_password
30秒等待元件的存在位於由後超時。
注:我已經使用implicit wait
和explicit wait
,我已經給從30爲70秒持續時間。測試偶爾得到通過。 請給我提供一個解決方案,這
我的代碼:
cab.setCapability(CapabilityType.VERSION, "5.1.1");
cab.setCapability(CapabilityType.PLATFORM, "Mac");
cab.setCapability("platformName", "android");
cab.setCapability("platformVersion", "5.1.1");
cab.setCapability("deviceName", "70af41a");
cab.setCapability("app", "/Users/xxx/Downloads/flipkart.apk");
cab.setCapability("appPackage", "com.flipkart.android"); //Replace with your app's package
cab.setCapability("appActivity", ".SplashActivity"); //Replace with app's Activity
driver = new AndroidDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), cab);
driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
element = driver.findElement(By.id("com.flipkart.android:id/mobileNo"));
element.sendKeys("1234567897");
//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);;
MobileElement signup = driver.findElement(By.id("com.flipkart.android:id/btn_msignup"));
signup.click();
WebDriverWait waitforsignup = new WebDriverWait(driver, 30);
waitforsignup.until(ExpectedConditions.presenceOfElementLocated(By.id("com.flipkart.android:id/et_password")));
//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
是不是你告訴代碼做的。 30秒後超時WebDriverWait(driver,30)'? – nullpointer