Finding an element using regex selenium java

感情迁移 提交于 2021-02-11 15:22:36

问题


I have an element whose value changes dynamically. This is the following:

"Pay 13.61"

I want to save the element 13.61 in a string and compare with 0.

This is how the appium structure looks like: enter image description here

I want to extract the value of pay. This is what I did:

String amt = wait.until(
                ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@text='Pay '+%s]"))).getText();
        logger.info(amt);
        logger.info("Cash Pay succeeded!");

Its not able to find the element, can anyone please help. Thanks. :)

来源:https://stackoverflow.com/questions/63125938/finding-an-element-using-regex-selenium-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!