mnkgrover08-zz / whatsapp_automation

Whatsapp Automation is a collection of APIs that interact with WhatsApp messenger running in an Android emulator, allowing developers to build projects that automate sending and receiving messages, adding new contacts and broadcasting messages multiple contacts.
GNU General Public License v3.0
204 stars 60 forks source link

Search Input Box not found #13

Closed lddd closed 5 years ago

lddd commented 5 years ago

Hello there,

I still receive this error on running python add_new_contact_producer.py

It says "Search Input Box not found"

I Inspected the device with Appium Inspector and actually the search xpathes are the same as in your workers/whatsapp_add_new_contact_producer.py code.

I am running the test on the following device setup.

Name: pixel_1 Device: pixel (Google) Path: /root/.android/avd/pixel_1.avd Target: Google Play (Google Inc.) Based on: Android 7.0 (Nougat) Tag/ABI: google_apis_playstore/x86 Skin: pixel_silver Sdcard: 512M

Please let me know what i can do. thanks in advance!

mnkgrover08-zz commented 5 years ago

Hi Roman you are using android version nougat where as Android Version used for this project is ANDROID-28 which is 2 versions above Nougat. Please see the attached screenshot for your reference. So you need to create a new avd with android 28 as android version and then run google contacts app. Make sure you turn off auto-correction in text settings in android Emulator/AVD. It may be a case that Google Contacts app is updated in Android-28 as compared to Android-Nougat. image-1

one more thing. search_text_element_xpath = '//android.widget.EditText[contains(@resource-id,"search_view") and contains(@text,"Search contacts")]'

image-4

This is the xpath which is not found in your setup. It has 2 conditions one is ID of element and other is placeholder text. Please find the screenshot attached for reference.

Most probably after updating android version your system should work, if not let me know. I would be happy to help.

For Reference I am pasting my AVD configuration.

Name: pixel_1 CPU/ABI: Google APIs Intel Atom (x86) Path: /home/mayank/.android/avd/pixel_1.avd Target: google_apis [Google APIs] (API level 28) Skin: pixel_2_xl SD Card: 100 MB hw.dPad: no hw.lcd.height: 2880 runtime.network.speed: full hw.accelerometer: yes hw.device.name: pixel_2_xl vm.heapSize: 256 skin.dynamic: yes hw.device.manufacturer: Google hw.lcd.width: 1440 hw.gps: yes hw.initialOrientation: Portrait image.androidVersion.api: 28 hw.audioInput: yes image.sysdir.1: system-images/android-28/google_apis/x86/ tag.id: google_apis showDeviceFrame: yes hw.camera.back: virtualscene hw.mainKeys: no AvdId: pixel_1 hw.camera.front: emulated hw.lcd.density: 560 avd.ini.displayname: pixel_1 hw.arc: false hw.gpu.mode: auto hw.device.hash2: MD5:1a4fa6b2569f0b76bfb9824b6b6fc976 hw.ramSize: 1536 hw.trackBall: no PlayStore.enabled: false fastboot.forceColdBoot: no hw.battery: yes hw.cpu.ncore: 2 hw.sdCard: yes tag.display: Google APIs runtime.network.latency: none hw.keyboard: yes hw.sensors.proximity: yes disk.dataPartition.size: 800M hw.sensors.orientation: yes avd.ini.encoding: UTF-8 hw.gpu.enabled: yes

image-2 image-3

Cheers Mayank

lddd commented 5 years ago

Thanks with latest Android Version Code works.

Would have a few more questions, if you have some time please hit me up. best regards.