0

EDIT There was a bug in Firefor driver. It was solved by using chrome driver.

enter image description hereI am new to python and I am developing a script that will send message on whatsapp using webwhatsapp. But I am not able to write anything in text inputfeild using driver.send_key('message') method.

<input type="text" class="input input-search" data-tab="2" dir="auto" spellcheck="false" title="Search or start new chat" value="">

CODE

contactSearch=driver.find_element_by_xpath('//*[@title="Search or start new chat"]').click()
contactSearch.send_keys("name")

I have tried contactSearch.clear() and click() method also but the input remains blank.the code is from https://web.whatsapp.com/ go there login and there will be a feild called Search or start new chat.I want to input text in that field.

1 Answer 1

1

You are not logged in to whatsapp in your selenium session and hence there is no "New chat" button. By default, selenium starts a brand new browser session with default preferences, no browser history or cookies.

Sign up to request clarification or add additional context in comments.

3 Comments

@alexce I can manuallu login and New chat button feature works just fine.The problem is where when I try to enter anything in input field it remains blank. driver.send_key('message') won't enter message in input field.. thanks.
@Priyamvaidya yeah, but you do it manually. You have to mimic the logging logic in your Python/Selenium code as well.
I have updated the question. It would be great if you take another look. thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.