Я использовал sapui5 с xml view и java проектом, используя Selenium 1.82 для автоматического тестирования.
XML-код, как это
<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:f="sap.ui.layout.form" xmlns:l="sap.ui.layout">
<Panel expanded="true" expandable="true" width="auto">
<headerToolbar>
<Toolbar>
<Title text="{i18n>POLICY_HOLDER_INFO_BASIC_INFO}" />
</Toolbar>
</headerToolbar>
<content>
<f:SimpleForm layout="ResponsiveGridLayout" labelSpanL="3" labelSpanM="3" labelSpanS="12" editable="true">
<f:content>
<VBox>
<CheckBox id="SameWithInsured" text="{i18n>POLICY_HOLDER_INFO_SAME_WITH_INSURED}" groupName="holderstatus1" selected="{searchModel>/d/SamewithInsured}" select="changeSameWithInsured"/>
<layoutData>
<l:GridData span="L12 M12 S12" indent="L3 M3 S3"></l:GridData>
</layoutData>
</VBox>
<Label text="{i18n>POLICY_HOLDER_INFO_IDENTIFICATION}" />
<VBox>
<RadioButton id="PHPerson" text="{i18n>POLICY_HOLDER_INFO_INDIVIDUAL}" enabled="{ path: '/d/SamewithInsured', model: 'searchModel', formatter: '.isPHDEditEnabled'}" groupName="holderstatus" selected="{= ${searchModel>/d/Person}===true}" select="clearRelation"/>
</VBox>
<VBox>
<RadioButton id="PHLegalEntity" text="{i18n>POLICY_HOLDER_INFO_CORPORATION}" enabled="{ path: '/d/SamewithInsured', model: 'searchModel', formatter: '.isLegalEntityEnabled'}" groupName="holderstatus" selected="{=${searchModel>/d/LegalEntity}===true}" select="clearRelation"/>
</VBox>
<Label text="{i18n>POLICY_HOLDER_INFO_RELATIONSHIP}"/>
<Select id="relationSelect" width="100%" selectedKey="{searchModel>/d/RelationshipKey}" enabled="{ path: '/d/SamewithInsured', model: 'searchModel', formatter: '.isPHDEditEnabled'}" change="relationSelectChange">
<items>
<core:Item key="1" text="{i18n>POLICYHOLDER_BASICINFO_RELATION_BLANK}" />
<core:Item key="2" text="{i18n>POLICYHOLDER_BASICINFO_RELATION_ELF}" enabled="{=${searchModel>/d/LegalEntity}===false}"/>
<core:Item key="3" text="{i18n>POLICYHOLDER_BASICINFO_RELATION_SPOUSE}" enabled="{=${searchModel>/d/LegalEntity}===false}"/>
</items>
</Select>
</f:content>
</f:SimpleForm>
</content>
</Panel>
</core:FragmentDefinition>
Мой тестовый скрипт (драйвер был создан)
WebDriverWait wait = new WebDriverWait(driver,30);
WebElement e = wait.until(ExpectedConditions.elementToBeClickable(dirver.findElement(By.xpath("//*[text()[contains(.,'" + word + "')]]"))));
e.click;
Я тоже пробовал
WebElement e = wait.until(ExpectedConditions.elementToBeClickable(driver.findElement(By.xpath("//core:FragmentDefinition/Panel/content/f:SimpleForm/f:content/Select/items/core:Item[contains(.,'" + word +"')]"))));
got org.openqa.selenium.InvalidSelectorException: Невозможно найти элемент с выражением xpath // core: FragmentDefinition / Panel / content / f: SimpleForm / f: content / Select / items / core: Item [содержит (. , '配偶')] из-за следующей ошибки:
Ошибка: префикс пространства имен не объявлен: core
Для документации об этой ошибке, пожалуйста, посетите: http://seleniumhq.org/exceptions/invalid_selector_exception.html