Skip to content

Commit fc2c290

Browse files
committed
feat: focus before clicking on submit button
1 parent bcdc3bc commit fc2c290

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lmao/ms_copilot/ms_copilot_api.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,15 @@ def prompt_send(
475475

476476
# Count number of bot's responses
477477
bot_messages_len_start = self._conversation_parse("count")
478-
time.sleep(0.1)
479478
logging.info(f"Found {bot_messages_len_start} bot messages")
479+
time.sleep(0.1)
480480

481481
# Submit
482482
logging.info("Clinking on submit button")
483-
self.driver.execute_script(_GET_SUBMIT_BUTTON).click()
483+
submit_button = self.driver.execute_script(_GET_SUBMIT_BUTTON)
484+
submit_button.focus()
485+
time.sleep(0.1)
486+
submit_button.click()
484487

485488
# Wait until bot starts responding
486489
logging.info("Waiting for bot to start responding")

0 commit comments

Comments
 (0)