Hi Team,
I want to get text " From" “£8.60” as you can see in above heirachy of my flutter application. I am automating my flutter application using Appium flutter driver in typeScript language.
I want to get list of child Text widgets and read text from them iteratively and then concatenate all the texts into one and check does it match the expected one.
What is the best way to achieve this?
I tried below but I cannot able to getElementText() like this. When my test run it just tries to get text but it freeze at that time because it fails to do so and timeout error.
const catalogPrice = find.descendant({
of: find.byValueKey(`catalog_product_#${index}`),
matching: find.byValueKey('catalog_product_card_price'),
});
const textWidget = find.descendant({
of: find.byValueKey(catalogPrice),
matching: find.byType('Text'),
matchRoot: true,
firstMatchOnly: false,
});
console.log('$$$$$$$$$');
console.log(textWidget);
console.log('@@@@@@@@@@@@@@@@@@@@@@');
const price = await driver.getElementText(textWidget);
It would be very helpful if someone can please let me know what I am missing at my end. Thanks