在使用Appium和Java的移动测试自动化上没有出现这样的元素问题

在使用Appium和Java的移动测试自动化上没有出现这样的元素问题,java,selenium,xpath,automation,appium,Java,Selenium,Xpath,Automation,Appium,我正在使用Appium和selenium自动化此注册页面 但在这段代码中,我得到了以下错误 Failed Step: Register to Gridlastic using First Name, Last Name, Comapany, Work Email, Username and Password in the following table <table:/resources/gridlastic_registration_details.csv> Spe

我正在使用Appium和selenium自动化此注册页面

但在这段代码中,我得到了以下错误

    Failed Step: Register to Gridlastic using First Name, Last Name, Comapany, Work Email, Username and Password in the following table <table:/resources/gridlastic_registration_details.csv>
    Specification: specs\GridlasticRegistration.spec:16
    Error Message: org.openqa.selenium.TimeoutException: Timed out after 15 seconds waiting for element to be clickable: Proxy element for: org.openqa.selenium.support.pagefactory.DefaultElementLocator@fae9e82
    Build info: version: '2.46.0', revision: '61506a4624b13675f24581e453592342b7485d71', time: '2015-06-04 10:22:50'
    System info: host: 'Mitrai-OsandaN', ip: '192.168.88.2', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
    Driver info: io.appium.java_client.android.AndroidDriver
    Capabilities [{deviceScreenSize=768x1280, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, version=5.1.0, deviceName=192.168.88.101:5555, platform=ANDROID, deviceUDID=192.168.88.101:5555, desired={browserName=chrome, platformName=Android, version=5.1.0, deviceName=My phone, platform=ANDROID}, platformVersion=5.1, webStorageEnabled=false, locationContextEnabled=false, takesScreenshot=true, browserName=chrome, javascriptEnabled=true, deviceModel=Custom Phone - 5.1.0 - API 22 - 768x1280, platformName=Android, deviceManufacturer=unknown}]
    Session ID: 4ec65f50-9746-4093-ae33-f0d1f735652f
    Stacktrace: 
    org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:80)
    org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:229)
失败步骤:使用下表中的名字、姓氏、公司名称、工作电子邮件、用户名和密码注册到Gridlastic
规格:specs\GridlasticRegistration.规格:16
错误消息:org.openqa.selenium.TimeoutException:等待元素可单击15秒后超时:代理元素:org.openqa.selenium.support.pagefactory。DefaultElementLocator@fae9e82
构建信息:版本:“2.46.0”,修订版:“61506A4624B13675F24581E4535952342B7485D71”,时间:“2015-06-04 10:22:50”
系统信息:主机:'Mitrai OsandaN',ip:'192.168.88.2',os.name:'Windows 10',os.arch:'amd64',os.version:'10.0',java.version:'1.8.0_121'
驱动程序信息:io.appium.java_client.android.AndroidDriver
功能[{deviceScreenSize=768x1280,networkConnectionEnabled=true,warnings={},databaseEnabled=false,version=5.1.0,deviceName=192.168.88.101:5555,platform=ANDROID,DeviceAudid=192.168.88.101:5555,所需={browserName=chrome,platformName=ANDROID,version=5.1.0,deviceName=My phone,platform=ANDROID},platformVersion=5.1,WebStorage Enabled=false,locationContextEnabled=false,takesScreenshot=true,browserName=chrome,javascriptEnabled=true,deviceModel=Custom Phone-5.1.0-API 22-768x1280,platformName=Android,deviceManufacturer=unknown}]
会话ID:4ec65f50-9746-4093-ae33-f0d1f735652f
堆栈跟踪:
org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:80)
org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:229)
请帮我解决这个问题。即使我删除了“WebDriverWait wait”,它也会说“没有这样的元素”。我认为问题在于xpath。但是我尝试了很多XPath,仍然得到相同的错误


请注意,我正在使用android chrome浏览器自动执行此方案。

最后我找到了这个问题的答案。我使用android chrome浏览器小部件的xpath作为元素。这是错误的,修复方法是我必须使用桌面浏览器的xpath,如下所示

 @FindBy(xpath = "//input[@name='fname']") WebElement FIRST_NAME_TEXT_BOX;

尝试将谓词
[@text='First Name']
替换为
[@placeholder='First Name']
是。它必须是占位符。@Andersson我尝试使用占位符。但它不起作用。同样的错误也会发生。请注意,我正在使用android chrome浏览器来自动化这个场景。很好,Osanda。请将您自己的答案标记为已接受答案,以便此问题不会显示为未接受答案。
 @FindBy(xpath = "//input[@name='fname']") WebElement FIRST_NAME_TEXT_BOX;