I had used sapui5 with xml view and java project, using Selenium 1.82 for automated testing. When I used By.xpath , NoSuchElementException occurred. I have tried By.xpath(“//*[text()[contains(., ‘”+ 父母 +”’)]]” and By.xpath(“//*contains(@text, ‘”+父母+”’))”) , the same exception happened. How should I do? Would anybody give advised will be deeply appreciated.
Relation.view.xml
<Select id=”relationSelect” selectedKey=”{Page>relation}”>
<item>
<core:Item key=”1” text=”請選擇”/>
<core:Item key=”2” text=”父母”/>
<core:Item key=”3” text=”配偶”/>
</item>
</Select>
Test script (driver had been instanced)
WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement e = driver.findElement(By.xpath(“//*[text()=’”+ “父母” +”’]”);
wait.until(ExpectedConditions.elememtToBeClickable(e));
e.click();
I also tried By.id(“relationSelect”), got the same exception. The code By.xpath("//[*text()='"+ "父母"+"']"); worked during March 26 between April 17 this year. After the day (April 17th), when I restart run auto testing on May 2 it failed.