Why do my tests fail when run together, but pass individually?

前端 未结 7 1130
有刺的猬
有刺的猬 2020-12-29 23:56

When I write a test in Visual Studio, I check that it works by saving, building and then running the test it in Nunit (right click on the test then run).

The test wo

7条回答
  •  时光说笑
    2020-12-30 00:24

    Two things you can try

    1. put the break point between the following two lines. And see which page are you in when the second line is hit
    2. Introduce a slight delay between these two lines via Thread.Sleep

      Driver.FindElement(By.Id("submenuitem4")).Click(); var headerelement = Driver.FindElement(By.ClassName("header"));

提交回复
热议问题