Harsha
1
Hi Team,
I am using appium flutter driver, can someone please tell me how can I get text from the child element?
My current code is:
await driver.execute(‘flutter:waitFor’, find.byValueKey(line_graph
));
btn = find.descendant({
of: find.byValueKey('line_graph'),
matching: find.byValueKey('test'),
matchRoot: false,
firstMatchOnly: true,
});
await driver.execute('flutter:waitFor', btn);
const firstdate: string = await driver.getElementText(btn);
console.log(firstdate);
Error:
strong textCode of key:
Harsha
2
@Aleksei Can you please provide some thoughts on the same?
It is probably the error message itself is confusing, but I assume what is really happening the retrieved element text equals to null
and thus the above error is thrown: https://github.com/Mindula-Dilthushan/flutter/blob/8135a4bedac87a8fc61318f1848f7acc9a511964/packages/flutter_driver/lib/src/common/handler_factory.dart#L406
Harsha
5
Did you mean there is something wrong in my automation script code?
Harsha
6
Can you please tag someone who use flutter and can provide any thoughts on the same? That would be really helpful. Thanks ![:slight_smile: :slight_smile:](//discuss.appium.io/images/emoji/twitter/slight_smile.png?v=9)
I don’t know for sure. Maybe the located element is not the one that is actually needed or a race condition happens there