A
A
AZALHABR2022-03-23 14:37:52
C++ / C#
AZALHABR, 2022-03-23 14:37:52

C# Selenium. How to make a click immediately after entering 6 characters?

I write in selenium in c#. How to make it so that after entering the captcha - selenium clicked on the "next" button itself? Saw it from a friend. He set it so that after entering 6 characters, the program itself pressed the button. I only found for java here: https://stackoverflow.com/questions/44619071/how-t...
The first answer is there, the one with the checkmark. It works, but for Java, I need it in C#.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergey, 2022-03-24
@AZALHABR

read / learn about functional programming and there will be no problems with translating code from language to language

wait.Until(x => {
        var size = 
          x.FindElement(By.CssSelector(selector)).GetAttribute("value").Length;
        if (size >= 5) {
          return true;
        } else {
          Console.Error.Write("waiting for specific text length");
          return false;
        }
      });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question