且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么我的测试一起运行时会失败,但要单独通过?

更新时间:2023-01-10 18:15:37

可以尝试的两件事

  1. 在以下两行之间输入断点.并查看第二行时您在哪个页面上
  2. 通过Thread.Sleep在这两行之间引入一点延迟

  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"));

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