Please see:
But this is some Java browser automation example using Selenium Webdriver and you cannot save the phone number of the incoming messages to contacts for e.g because you don´t have access to contacts on web.whatsapp.com.
So my idea was to do the same with Appium directly on some emulated device instead.
@lddd you can. but i can not help you with Appium JavaScript. never used it as client for appium.
Ok thanks a lot.
I am very new to both Java and JavaScript
Now 2 more questions:
-
Lets say it´s a Java Client. How to keep such Test running in the background so it´s continuously waiting for new messages and do something with the results? I would have to execute such Client Script every second by cronjob or how is this be done?
-
Would it be possible to do other actions in the same Appium Test like sending a message? What if both actions would happen to the same time? I guess its not possible for Appium to parallel execute two functions on the same App window running only 1 Test for the same device?
thanks for all the kind help so far. Very nice.
ok. at least now we have details. i suggest use 2 driver strategy. one driver opens web (no matter on computer or on some emulated device) and looking for messages. another driver does another job with another device/web (depending what exactly you need). i made test like a chat - when 2 apps open on different devices and one sending something, another one respond.
Hey Aleksel.
One automation test for each task sounds like a good idea. 1 for reading messages, 1 for sending messages.
I think browser automation for my case is not possible because on WhatsApp (web.whatsapp.com) you cannot add new contacts. And i want to automatically save phone numbers for all incoming messages containing a specific keyword
For example: A person sends “subscribe”
Now i want to have one Appium Test running in the background of my server doing this. It should permanently scan all incoming messages on the emulated device and add numbers to the contact list.