1

I am new to python selenium and working on creating POC for the test automation.

I am trying to open my internal application on firefox. I am getting a pop up to enter the credentials and cursor is in the text box. steps need to automate are :

  1. send user name in the text box where current cursor is
  2. send hot key "TAB"
  3. send password
  4. send hot key "TAB"
  5. click on current cursor position

Problem is, there is no way i can identify the text box (PFA). I can only think of making it work on the basis of current cursor position. Please suggest if I can go with other strategy.

Firefox

Code I tried to get the cursor position:

driver.maximize_window()
winsize=driver.get_window_size()
print(winsize)

cur_loc=driver.get_window_position()
print(cur_loc)
Devansh Soni
  • 771
  • 5
  • 16

1 Answers1

0

It's very easy if you are using pyautogui:

import pyautogui
pyautogui.position() # get cursor position
pyautogui.click() # click on the position
Luís Eduardo
  • 52
  • 1
  • 6