"Trying to send whatsapp message automatically, pre-filled message in the code, that will automatically appear in the text field of a whatsapp chat, But the user needs to click the send button.Is there is any way to send whatsapp message automatically.I tried most of the same questions in the stack overflow.But i cant find any solution"
sendmessage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setData(Uri.parse(
"https://api.whatsapp.com/send?phone="
+ ccp.getFullNumberWithPlus() + enternumber.getText()
+ "&text=" +msg.getText()
));
startActivity(intent);
}
});
just use
from selenium.webdriver.common.keys import Keys
and then your message variable to write the message
the code to writhe the mesage: .send_keys("message")
/you could also send the message variable
the code to send the mesage/press enter: .send_keys(Keys.RETURN)
alright now go write it now
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.