Closed lalamax3d closed 3 years ago
You found any replacement?
no. i wasn't able to confirm which one from above possibly can work and also wasn't able to find some other solution.
I could avoid PyAutoIt in Ubuntu 20.10 by making the following amendments, it uses the <input>
tag inside the <button>
:
# About 6 seconds
def _send_image(filename: str):
"""Function to send Images (jpg, png)
Args:
filename (str): Image full filepath.
"""
# Attachment Drop Down Menu
clipButton = wait.until(EC.presence_of_element_located(
(By.XPATH,
'//*[@id="main"]/footer//*[@data-icon="clip"]/..')))
clipButton.click()
# To send an Image
imgButton = wait.until(EC.presence_of_element_located(
(By.XPATH,
'//*[@id="main"]/footer//*[@data-icon="attach-image"]/../input')))
imgButton.send_keys(filename)
sendButton = wait.until(EC.presence_of_element_located(
(By.XPATH,
'//*[@data-icon="send"]')))
sendButton.click()
# Waiting for the pending clock icon to disappear
wait.until_not(EC.presence_of_element_located(
(By.XPATH,
'//*[@id="main"]//*[@data-icon="msg-time"]')))
# About 6 seconds
def _send_file(filename: str):
"""Function to send Documents (PDF, Word file, PPT, etc.)
Args:
filename (str): Document full filepath.
"""
# Attachment Drop Down Menu
clipButton = wait.until(EC.presence_of_element_located(
(By.XPATH,
'//*[@id="main"]/footer//*[@data-icon="clip"]/..')))
clipButton.click()
# To send a Document(PDF, Word file, PPT)
docButton = wait.until(EC.presence_of_element_located(
(By.XPATH,
'//*[@id="main"]/footer//*[@data-icon="attach-document"]/../input')))
docButton.send_keys(filename)
sendButton = wait.until(EC.presence_of_element_located(
(By.XPATH,
'//*[@data-icon="send"]')))
sendButton.click()
# Waiting for the pending clock icon to disappear
wait.until_not(EC.presence_of_element_located(
(By.XPATH,
'//*[@id="main"]//*[@data-icon="msg-time"]')))
@jrom99 , thanks, I'll test it over weekend and close the issue. huge thanks again.
just wanted to say, thanks again, for help, issue sorted @jrom99 . have a good day
Hi, thanks for amazing tool. on linux, pyautoit doesn't work, ( i am on ubuntu 20, atleast for me ). i tried searching for replacement. it seems its needed while attaching file open dialog >> giving file_path >> hitting OK button etc.
Q. is pyautoit only for windows based solution? or works with linux as well? to control dialogs with mouse etc? Q. is there a fix / solution? huge thanks. Q. can autopy OR pyautogui be used instead of this.?