使用appium动画gif后无法单击元素

时间:2018-07-05 18:02:48

标签: java selenium appium

我想在登录后执行搜索选项,并且在登录的加载时间中有动画和GIF图像。到目前为止,我的代码可以正常工作,但是登录后我无法在模拟器中的屏幕上找到任何元素,但是如果我在移动设备上运行相同的代码,我可以识别元素但无法单击(单击操作无法反映在屏幕上)

@Test
public static void testhjg() throws MalformedURLException {
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "APP");
File app = new File(appDir, "app-release (3).apk");
DesiredCapabilities capabilities =new DesiredCapabilities();        
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");                
capabilities.setCapability("deviceName", "My device");              
capabilities.setCapability("platformVersion", "6.0.1");             
capabilities.setCapability("platformName", "Android");  
capabilities.setCapability("autoGrantPermissions", true);
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", APPDetails.appPackage);    
capabilities.setCapability("appActivity", APPDetails.appActivity);
capabilities.setCapability("app-wait-activity", "com.parkquility.ui.authentication.AuthenticationActivity");    
capabilities.setCapability("app-wait-activity", "com.parkquility.ui.home.HomeActivity");
capabilities.setCapability("app-wait-activity", "com.parkquility.ui.Profile.ProfileActivity");

capabilities.setCapability("newCommandTimeout","240");

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

driver.findElementById("googleButton").click();
driver.findElementById("com.google.android.gms:id/account_name").click();

MobileElement ProfileTab = (MobileElement) driver.findElement(By.id("findParkingView"));
WebDriverWait wait = new WebDriverWait(driver, 60);
wait.until(ExpectedConditions.visibilityOf(ProfileTab));
ProfileTab.click();

我在这里提供了代码

NoElementError - reflecting

在这个问题上,您能请谁帮忙吗

0 个答案:

没有答案