selenium element not interactable

后端 未结 2 1272
时光取名叫无心
时光取名叫无心 2021-01-29 01:48

i started using selenuim, node js

it was working all perfect so far, sudenly the same script is throwing and error

\"unhandled promise rejection warning element

相关标签:
2条回答
  • 2021-01-29 02:17

    These locators worked for me for the url you shared:

    driver.findElement(By.xpath('(//input[@id="username"])[2]')).sendKeys('test@emal');
    driver.findElement(By.xpath('(//input[@id="password"])[2]')).sendKeys('passowrod');
    driver.findElement(By.xpath('(//button[@class="boton acceder"])[2]')).click();
    

    The reason for using 2nd index for all the elements is that the same elements are in HEADER which are hidden.

    Note: I tried these in python, so please adjust if any string syntax error.

    0 讨论(0)
  • 2021-01-29 02:29

    The problem: While running the automation, the window size is is not fully presented on screen so some elements are rendered outside of the visible area in your configured chrome web driver.

    The solution would be using this snippet in your base configuration:

    browser.driver.manage().window().maximize();
    
    0 讨论(0)
提交回复
热议问题