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

  • Please share your script. – Mate Mrše Oct 11 at 8:04
  • I can't get your issue. Does Selenium passes 2 but should 6 symbols, or or the save button gets enabled when you do not expect? Or the issue is in how different your site behaves when you interact with it manually and when you interact with Selenium? – Alexey R. Oct 11 at 11:18
  • 1
    Add more description and paste your code so that others can understand what you are trying to ask. also go through the link how to ask – Alok Oct 12 at 15:27

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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.