java.lang.IllegalArgumentException: @ $ Proxy19: один из [name, xpath, iOSNsPredicate] должен быть заполнен - PullRequest
0 голосов
/ 14 июня 2019

Все xpaths устарели, и все еще я получаю эту проблему каждый раз, когда я запускаю скрипт.

java.lang.IllegalArgumentException: @$Proxy19: one of [uiAutomator, accessibility, className, id, tagName, name, xpath, linkText, partialLinkText, windowsAutomation, iOSClassChain, iOSNsPredicate] should be filled

  java.lang.IllegalArgumentException: @$Proxy19: one of [uiAutomator, accessibility, className, id, tagName, name, xpath, linkText, partialLinkText, windowsAutomation, iOSClassChain, iOSNsPredicate] should be filled
    at io.appium.java_client.pagefactory.bys.builder.AppiumByBuilder.getFilledValue(AppiumByBuilder.java:109)
    at io.appium.java_client.pagefactory.bys.builder.AppiumByBuilder.createBy(AppiumByBuilder.java:148)
    at io.appium.java_client.pagefactory.DefaultElementByBuilder.getBys(DefaultElementByBuilder.java:133)
    at io.appium.java_client.pagefactory.DefaultElementByBuilder.buildMobileNativeBy(DefaultElementByBuilder.java:182)
    at io.appium.java_client.pagefactory.DefaultElementByBuilder.buildBy(DefaultElementByBuilder.java:216)
    at io.appium.java_client.pagefactory.AppiumElementLocatorFactory.createLocator(AppiumElementLocatorFactory.java:66)
    at io.appium.java_client.pagefactory.AppiumElementLocatorFactory.createLocator(AppiumElementLocatorFactory.java:53)
    at io.appium.java_client.pagefactory.AppiumElementLocatorFactory.createLocator(AppiumElementLocatorFactory.java:1)
    at org.openqa.selenium.support.pagefactory.DefaultFieldDecorator.decorate(DefaultFieldDecorator.java:56)
    at io.appium.java_client.pagefactory.AppiumFieldDecorator.decorate(AppiumFieldDecorator.java:155)
    at org.openqa.selenium.support.PageFactory.proxyFields(PageFactory.java:113)
    at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:105)
    at com.hlb.mobileautomation.pages.AccountSummaryPage.<init>(AccountSummaryPage.java:22)
    at com.hlb.mobileautomation.stepdefinitions.MainSteps.user_navigates_to_quick_links_for_send_money(MainSteps.java:263)
    at ✽.Then user navigates to quick links for send money(src/test/resources/features/FundTranferFavoriteAccount.feature:37)

Неудачные сценарии: src / test / resources / features / FundTranferFavoriteAccount.feature: 43 # Краткое описание сценария: впервые войти в приложение

1 Scenarios (1 failed)
4 Steps (1 failed, 3 passed)
2m2.672s

java.lang.IllegalArgumentException: @$Proxy19: one of [uiAutomator, accessibility, className, id, tagName, name, xpath, linkText, partialLinkText, windowsAutomation, iOSClassChain, iOSNsPredicate] should be filled
    at io.appium.java_client.pagefactory.bys.builder.AppiumByBuilder.getFilledValue(AppiumByBuilder.java:109)
    at io.appium.java_client.pagefactory.bys.builder.AppiumByBuilder.createBy(AppiumByBuilder.java:148)
    at io.appium.java_client.pagefactory.DefaultElementByBuilder.getBys(DefaultElementByBuilder.java:133)
    at io.appium.java_client.pagefactory.DefaultElementByBuilder.buildMobileNativeBy(DefaultElementByBuilder.java:182)
    at io.appium.java_client.pagefactory.DefaultElementByBuilder.buildBy(DefaultElementByBuilder.java:216)
    at io.appium.java_client.pagefactory.AppiumElementLocatorFactory.createLocator(AppiumElementLocatorFactory.java:66)
    at io.appium.java_client.pagefactory.AppiumElementLocatorFactory.createLocator(AppiumElementLocatorFactory.java:53)
    at io.appium.java_client.pagefactory.AppiumElementLocatorFactory.createLocator(AppiumElementLocatorFactory.java:1)
    at org.openqa.selenium.support.pagefactory.DefaultFieldDecorator.decorate(DefaultFieldDecorator.java:56)
    at io.appium.java_client.pagefactory.AppiumFieldDecorator.decorate(AppiumFieldDecorator.java:155)
    at org.openqa.selenium.support.PageFactory.proxyFields(PageFactory.java:113)
    at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:105)
    at com.hlb.mobileautomation.pages.AccountSummaryPage.<init>(AccountSummaryPage.java:22)
    at com.hlb.mobileautomation.stepdefinitions.MainSteps.user_navigates_to_quick_links_for_send_money(MainSteps.java:263)
    at ✽.Then user navigates to quick links for send money(src/test/resources/features/FundTranferFavoriteAccount.feature:37)

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 125.135 sec <<< FAILURE! - in TestSuite
feature(com.hlb.mobileautomation.runner.RunCukesTest)  Time elapsed: 123.002 sec  <<< FAILURE!
cucumber.runtime.CucumberException: java.lang.IllegalArgumentException: @$Proxy19: one of [uiAutomator, accessibility, className, id, tagName, name, xpath, linkText, partialLinkText, windowsAutomation, iOSClassChain, iOSNsPredicate] should be filled
    at com.hlb.mobileautomation.runner.RunCukesTest.feature(RunCukesTest.java:39)
Caused by: java.lang.IllegalArgumentException: @$Proxy19: one of [uiAutomator, accessibility, className, id, tagName, name, xpath, linkText, partialLinkText, windowsAutomation, iOSClassChain, iOSNsPredicate] should be filled

Результаты:

Неудачные тесты:

RunCukesTest.feature:39 » Cucumber java.lang.IllegalArgumentException: @$Proxy...

Я использовал объектную модель страницы с огурцом.

Ответы [ 2 ]

0 голосов
/ 22 июня 2019

Просто чтобы прояснить это здесь, причина ошибки из-за пустого Xpath:

@AndroidFindBy(xpath = "")
private MobileElement abc;
0 голосов
/ 14 июня 2019

Я использую фабрику страниц с огурцом.

Эта проблема возникает, если у вас есть ЗНАЧЕНИЕ ЗНАЧЕНИЯ ЛОКАТОРОВ в любом классе Java.

Например, -:

@iOSXCUITFindBy(xpath="")
@AndroidFindBy(id="vn.com.nitin.test.uat:id/hamburger_menu")
private MobileElement hamburger_menu;

Поэтому я искал все локаторы в фабрике страниц классов Java, и я ввел все исправленные и обновленные xpath, id, link и т. Д.

После этого у меня все работает нормально.

Вероятно, это поможетВы также.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...