0

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. :)

2
  • Why can't you simply use //*[starts-with(text(),'Pay ')]? Commented Jul 28, 2020 at 2:35
  • @supputuri didnt work :( Commented Jul 28, 2020 at 7:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.