mercredi 18 février 2015

How do I use python variable in a javascript?


I've been on a prowl looking for a way to access a non visible text field using selenium's webdriver. The only way i got it to work is using



driver.execute_script("document.getElementById('text_field').value+='XYS'")


However, instead of using XYZ, I want to use python variables.





Aucun commentaire:

Enregistrer un commentaire