[Python] Selenium in Windows vs Linux (Add value to the Date picker)

Discussão em 'Python' iniciado por Stack, Março 28, 2025.

  1. Stack

    Stack Membro Participativo

    The Main thing is that I try to add a date to the date field which is very easy:

    • Find Element / by using .send_keys("01/01/1990")

    But the problem is that in Windows all working fine - and the date picker looks like this [​IMG]

    But when I open it in a Linux box, the date picker opens like this (In the middle of the page with a shadow effect in the background) - which causes issues interacting with the input field: [​IMG]

    Extra:

    • Windows and Linux execution happening in the headless mode
    • Both using the latest Chrome driver

    What I have tried:

    • Using JS to remove this date picker, hide and etc...
    • using Actions / send_keys() and e.t.c...
    • Using JS to add value to the element (can add visually BUT when click on empty space date disappeared )

    So, I have two questions:

    • Why is Windows and Linux date picker open differently
    • What will be the way to add the date to the Linux version date picker (straight to the input .. NOT by using the date picker itself)

    UPDATE 1.0:

    • Looks like issue is smililar to this one: https://github.com/mui/mui-x/issues/4447
      • As in linux box it ix opened as MOBILE and not as Desktop version of the website.... any idea how to make it opened in Linux as Desktop website?
      • This does not work: options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3")

    Continue reading...

Compartilhe esta Página