dimanche 27 octobre 2019

Error no such element unable to locate element error when using selenium for python

I'm using the selenium python package to enable me to login into my router and change the password by simply running a script. I have been able to use navigate till the page to enter the new password where I keep getting an error.

I have tried using both the values for and also accessed via the table elements.

#using chrome to access web
driver = webdriver.Chrome()

driver.get('https://192.168.100.1/')

#find the username box and send value
driver.find_element_by_id('txt_Username').send_keys('root')

#find the password box and send value
driver.find_element_by_id('txt_Password').send_keys('@Idontlike5')

#click login button
driver.find_element_by_id('loginbutton').click()

#select advanced tab
driver.find_element_by_id('addconfig').click()

#select WLAN
driver.find_element_by_id('wlanconfig').click()

#input new password
wpa2 = driver.find_element_id('twlWpaPsk')
wpa2.clear()
wpa2.send_keys('21Savage')

#select 5g wlan
#wlan5g = driver.find_element_by_id('wlan5basic')

#click apply btn
apply = driver.find_element_by_id('btnApplySubmit')   
apply.click()

The id for the input for the new password should be correct but only returns an error.




Aucun commentaire:

Enregistrer un commentaire