Handle invalid login test case

Hi All,

How to handle invalid login test case? If I enter invalid credentials I’m getting an popup/alert “Invalid Credentials” but that popup/alert has no id or classpath so How can I write that code?
Can you please someone help me for solving this issue.

I am automating android app. testing. When I do inspect element , there
is no base to find error text element. Is there any way to do this?


I am able to access all other elements by id/xpath/classname etc but for
error text I am not getting any way to interact with it.