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

How to send image with caption #38

Closed
victorterancas opened this issue Dec 17, 2021 · 5 comments
Closed

How to send image with caption #38

victorterancas opened this issue Dec 17, 2021 · 5 comments

Comments

@victorterancas
Copy link

victorterancas commented Dec 17, 2021

Is my first time making a coment in github, i am sending an "improvement" of "send_picture()". It is how to send a picture with text on it:

def send_picture(self, picture, message): try: filename = os.path.realpath(picture) self.find_attachment() # To send an Image imgButton = self.wait.until(EC.presence_of_element_located( (By.XPATH, '//*[@id="main"]/footer//*[@data-icon="attach-image"]/../input'))) imgButton.send_keys(filename) inp_xpath = '//*[@id="app"]/div[1]/div[1]/div[2]/div[2]/span/div[1]/span/div[1]/div/div[2]/div/div[1]/div[3]/div/div/div[2]/div/div[2]' input_box = self.wait.until(EC.presence_of_element_located(( By.XPATH, inp_xpath))) input_box.send_keys(message + Keys.ENTER) self.send_attachment() print(f"Picture has been successfully sent to {self.mobile}") except (NoSuchElementException, Exception) as bug: print(bug) print(f'Failed to send a picture to {self.mobile}')

@victorterancas victorterancas changed the title How to send image with text. How to send image with caption Dec 17, 2021
@Kalebu
Copy link
Owner

Kalebu commented Dec 25, 2021

Hello @victorterancas, This is really interesting

Can you please adding to the main codebase and submit your pull request

Let me know if you would need assistance and any further clarification on that

You can also read How to make your first contribution

Looking forward seeing your contribution

Best regards
Kalebu

@badi95
Copy link
Contributor

badi95 commented Mar 17, 2022

Has this gotten merged in? I'd really like to use this feature.

@badi95
Copy link
Contributor

badi95 commented Mar 17, 2022

Manually added this to my system, and tested it. Seemed to work fine, so I created a PR for it.

@badi95
Copy link
Contributor

badi95 commented Mar 21, 2022

Issue ready to close?

@victorterancas
Copy link
Author

Yes. Thank you guys, i am still learning how to use github. 😅. Thank you @badi95 for giving me credits for the code, you made a nice job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants