Assert in Selenium C#

后端 未结 8 817
[愿得一人]
[愿得一人] 2021-01-07 11:45

Is there a Assert class present in Selenium C# just like we have in Coded UI test.

Or I should use the Microsoft.VisualStudio.TestTools.UnitTesting.Asser

8条回答
  •  猫巷女王i
    2021-01-07 12:04

    To use Assert you have to first create the unit testing project in Visual Studio.

    Or import the following reference to the project.

    using Microsoft.VisualStudio.TestTools.UnitTesting;
    // Using this you can use the Assert class.
    
    Assert.IsTrue(bool);
    Assert.IsFalse(bool);
    Assert.AreEqual(string,string);
    

提交回复
热议问题