Before entering entire text completely, Selenium is saving data



  • There is a form having only two field name and Code. Code validation criteria is minimum 2 and max six character. As soon as you enter 2 character save button become enable.

    Now, problem is when selenium enter two character in code save button become enable and data got saved while automating. but in reality Selenium code has to pass six characters in Code. Instead of six it is only passing two.

    I am using Cucumber and POM, C# Selenium webdriver

    thanks in advance



  • It sounds like there is some javascript that automatically executes as soon as the minimum condition is met.

    Does the 'save' button gain focus when it gets enabled? You may need to add a check that if focus from the text box is lost, you put it back in there. Or you may need to add a wait until the contents of the textbox = 6 chars before continuing execution of your code.

    Some code sample would be helpfull for troubleshooting.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2