Skip to content

Get Text from alert message #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gkvappium opened this issue May 14, 2019 · 2 comments
Open

Get Text from alert message #224

gkvappium opened this issue May 14, 2019 · 2 comments

Comments

@gkvappium
Copy link

I want to retrieve the text from an alert message. On android there is no problem. But on IOS, can't really get the text. I do not want to do a findElementByText and pass the entire value since there are some localization stuff involved.

There is a method in selenium ,something like driver.switchTo().alert().getText(). But couldn't figure out a way to use this method.

@SvetoslavTsenov , do you have any idea as to how to use it along with the plugin?

@SvetoslavTsenov
Copy link
Contributor

If I have to be honest I haven't try it but probably you could try to locate the alert by xpath and then use getText()

@gkvappium
Copy link
Author

gkvappium commented May 15, 2019

Hi @SvetoslavTsenov ,

Found a solution. There is method in wd to get the text from the alert (driver.driver.alertText() ). Gives the alert title as well as the alert message. Since i was looking into localization, wanted to use a generic method that can work across different languages (Using an npm pkg called franc-min for localization testing). Thanks for looking into this though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants