wd icon indicating copy to clipboard operation
wd copied to clipboard

How to listen for Events on a JavaScript Appium Client Test?

Open rmulr opened this issue 8 years ago • 2 comments

Hello there,

I´d like to create a JavaScript Client Appium automation solving the following problematic.

Listen for incoming messages inside some app

Now i have no idea how to get started here? Is there any way to catch up with such events in a Appium JavaScript client?

I could only found this so far: https://github.com/appium/java-client/blob/master/docs/The-event_firing.md

However this is for Java.

Sorry if this might be not the right place to ask but i could not find support on discuss.appium.io or by doing some Google search.

rmulr avatar Apr 17 '18 22:04 rmulr

Hi @lddd unfortunately there's no way to do this with the wd client, or with Appium in general. You'll need to think about how to automate it the way a user would, by inspecting the view to see if a message has arrived. Even more unfortunately, on iOS, push notification messages are not visible to automation.

jlipps avatar Apr 18 '18 17:04 jlipps

Thanks jlipps. I want to run such test on a android emulated device.

So i need to run code inside a loop to check X seconds for ui changes, is that what you mean?

rmulr avatar Apr 19 '18 09:04 rmulr