Scenario

  1. I fill in:
    textBox34.Text;
    textBox19.Text;
    textBox1.Text;

  2. I press the button

  3. I press the button a second time I get an error:

No frame element found with name or id ads_frame1

Code

Browser.SwitchTo().Frame(textBox34.Text); // переключаемся в фрейм IWebElement selector = Browser.FindElement(By.CssSelector(textBox19.Text)); textBox1.Text = selector.Text; Application.DoEvents(); selector.Click(); 

Question
Why when I press the button again, an error occurs?

    1 answer 1

    Most likely, after the first "search" (pass) you rebuild the page and as a result the frame disappears.

    • @ androschuk. After the first keystroke, the code is executed. I go to Chrome to check the availability of the frame. In Chrome, the frame is and has not changed. Press the button again - error - koverflow