sendKeys() in Selenium web driver

前端 未结 11 1812
野性不改
野性不改 2020-12-31 04:23

I am new to Selenium. I just want to send keys to a username text box and send a tab key both at a time so that text box can check for availability of username.

11条回答
  •  不知归路
    2020-12-31 05:06

    For python selenium,

    Importing the library,

    from selenium.webdriver.common.keys import Keys
    

    Use this code to press any key you want,

    Anyelement.send_keys(Keys.RETURN)
    

    You can find all the key names by searching this selenium.webdriver.common.keys.

提交回复
热议问题