Skip to content
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

Make clear_chats_of_all_groups() to clear chats of all whatsapp groups. #23

Closed
NavpreetDevpuri opened this issue Oct 12, 2020 · 2 comments · Fixed by #91
Closed

Make clear_chats_of_all_groups() to clear chats of all whatsapp groups. #23

NavpreetDevpuri opened this issue Oct 12, 2020 · 2 comments · Fixed by #91

Comments

@NavpreetDevpuri
Copy link
Member

NavpreetDevpuri commented Oct 12, 2020

Automate as follow or try something else

  1. go through all chats by using the DOWN arrow key because in HTML all chats are un-ordered
  2. determine someway that the currently active element on the browser is a group. browser.switch_to.active_element
  3. then if its a group then just automate Clear messages for that group
    ShareX_bge3iVVLh8
@NavpreetDevpuri NavpreetDevpuri changed the title Make clear_all_groups() to clear chats of all whatsapp groups. Make clear_chat_of_all_groups() to clear chats of all whatsapp groups. Oct 12, 2020
@NavpreetDevpuri NavpreetDevpuri changed the title Make clear_chat_of_all_groups() to clear chats of all whatsapp groups. Make clear_chats_of_all_groups() to clear chats of all whatsapp groups. Oct 12, 2020
@NavpreetDevpuri
Copy link
Member Author

tithiwa/tithiwa/group.py

Lines 113 to 130 in 7cef0e1

def exit_from_all_groups(self):
self._wait_for_an_presence_of_element(SELECTORS.GROUPS.GROUP_NAME_IN_CHATS)
self._wait_for_an_element_to_be_clickable(SELECTORS.MAIN_SEARCH_BAR).click()
preactive = None
self.browser.switch_to.active_element.send_keys(Keys.ARROW_DOWN)
curractive = self.browser.switch_to.active_element
while curractive != preactive:
groupnameelement = None
try:
groupnameelement = curractive.find_element(By.CSS_SELECTOR, SELECTORS.GROUPS.GROUP_NAME_IN_CHATS)
except:
pass
if groupnameelement != None:
groupname = groupnameelement.get_attribute('innerText')
self._wait_for_group_to_open_then_exit(groupname)
preactive = curractive
curractive.send_keys(Keys.ARROW_DOWN)
curractive = self.browser.switch_to.active_element

That's how we can go through all chats

@NavpreetDevpuri NavpreetDevpuri added the good first issue Good for newcomers label Oct 21, 2020
@NavpreetDevpuri
Copy link
Member Author

NavpreetDevpuri commented Oct 22, 2020

  1. go through all group chats same as in exit_from_all_groups()
  2. open group options using CHATROOM__OPTIONS
  3. press on Clear chat and wait for the chat to be cleared by using self._close_info()

@NavpreetDevpuri NavpreetDevpuri linked a pull request Oct 31, 2021 that will close this issue
Automate essentials automation moved this from To do to Done Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

1 participant