# Text Verification from Popup

**URL:** <https://discuss.appium.io/t/text-verification-from-popup/22762>\
**Category:** Issues/Bugs\
**Created:** [July 13, 2018, 9:49am UTC](https://discuss.appium.io/t/text-verification-from-popup/22762 "2018-07-13T09:49:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![street\_talent](https://discuss.appium.io/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@street\_talent](https://discuss.appium.io/u/street_talent)\
**Post date:** [July 13, 2018, 9:49am UTC](https://discuss.appium.io/t/text-verification-from-popup/22762/1 "2018-07-13T09:49:08Z")

</div>

Text Verification from Popup.  
I need to verify the text from popup  
example  
user enter the invalid username the popup with message is occurs like “Username/Password is inValid”  
i need to verify this the same message is shown to the user or not how i can ??  
using Appium JAVA on Android Application

Thanks

---

<div class="post-metadata">

**Author:** ![Tany\_S](https://discuss.appium.io/user_avatar/discuss.appium.io/tany_s/32/5663_2.png) [@Tany\_S](https://discuss.appium.io/u/Tany_S)\
**Post date:** [July 14, 2018, 11:28am UTC](https://discuss.appium.io/t/text-verification-from-popup/22762/2 "2018-07-14T11:28:52Z")

</div>

You can write a xpath to identify the text in popup,then use gettext() method and compare

---

<div class="post-metadata">

**Author:** ![street\_talent](https://discuss.appium.io/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@street\_talent](https://discuss.appium.io/u/street_talent)\
**Post date:** [July 17, 2018, 3:59pm UTC](https://discuss.appium.io/t/text-verification-from-popup/22762/3 "2018-07-17T15:59:21Z")

</div>

Thanks a lot i did this…

public void ValidUsernameInvalidPassword(String username, String password)

```
{
	mUsernameField.sendKeys(username);
	mPasswordField.sendKeys(password);
	mSignInButton.click();
	String result = mDriver.findElementById("dk.dsg.and.store.controllers:id/tvMessage").getText();
	System.out.println("Alert text Is -&gt; " + result);

	if ("Fejl ved logon. Forkert brugerID eller kode..".equals(result))

	{

		mDriver.findElementById("dk.dsg.and.store.controllers:id/btnOk").click();

	}
}
```

---

<div class="post-metadata">

**Author:** ![Tany\_S](https://discuss.appium.io/user_avatar/discuss.appium.io/tany_s/32/5663_2.png) [@Tany\_S](https://discuss.appium.io/u/Tany_S)\
**Post date:** [July 18, 2018, 3:47pm UTC](https://discuss.appium.io/t/text-verification-from-popup/22762/4 "2018-07-18T15:47:24Z")

</div>

what exactly error you are facing?  
logs from console or appium required for further investigation
