vendredi 9 septembre 2016

Using Selenium to test empty text field

So I am testing a web client which communicates with an engine that does something to a text file that I upload. So basically, I choose a file to upload, once this file is uploaded i can press start and the engine does its thing and returns a result. I have an option to name the result such that when the result comes back it will be have a predefined name. I am trying to test the scenario where no name is provided. When the page first starts up the name field has a default value call "domain". I grabbed the element using

self.nameField = driver.find_element_by_xpath("//input[@value='DomainLM']")

and then I cleared the field using

self.nameField.clear()

The problem is, once this line finish executing and I move on to upload a file, the default name pops back up in the name field, is there a way to permanently keep the name field blank? This also happens when I tried to uncheck some checkboxes, they recheck themselves when I move on in my test case. Does anyone know what the problem is? Thank you in advance!!

Aucun commentaire:

Enregistrer un commentaire