There was no way to differentiate groups and normal chat, therefore, I was forced to scroll through entire list of contacts, where it checks for the message "You can't send messages to this group because you're no longer a participant", if message is found then it deletes the group. Now, if we allow the program to run freely without any time.sleep() it scrolls through entire list of contact without finding any match, _wait_for_presence_of_an_element was also not working so to reduce its speed I had used sleep(0.5).
There was another problem, when delete chat is successful, program losts track of which contact or group should be clicked next. So, we have to scroll from top again, But since we have already checked top few contacts, I added count variable which contains number of chats checked so far, so that it quickly scrolls through those number of chats quickly without waiting for 0.5seconds, and then continues it search again.
Constants file didn't contain any delete group button selector, so I have added GROUPS__DELETE_GROUP selector.
There was no way to differentiate groups and normal chat, therefore, I was forced to scroll through entire list of contacts, where it checks for the message "You can't send messages to this group because you're no longer a participant", if message is found then it deletes the group. Now, if we allow the program to run freely without any time.sleep() it scrolls through entire list of contact without finding any match, _wait_for_presence_of_an_element was also not working so to reduce its speed I had used sleep(0.5). There was another problem, when delete chat is successful, program losts track of which contact or group should be clicked next. So, we have to scroll from top again, But since we have already checked top few contacts, I added count variable which contains number of chats checked so far, so that it quickly scrolls through those number of chats quickly without waiting for 0.5seconds, and then continues it search again.
Constants file didn't contain any delete group button selector, so I have added GROUPS__DELETE_GROUP selector.