I have a problem with finding an element. When I run my test, then sometimes I get this error in my test step and sometimes it works. I tried wait steps and other wait methods in code, but it doesn't help me.
ArtOfTest.Common.Design.Exceptions.ExecutionException: Exception thrown executing coded step: 'Check unit prices in the modal form'. ---> System.NullReferenceException: Object reference not set to an instance of an object. at ArtOfTest.WebAii.Controls.HtmlControls.HtmlDiv..ctor(Element e)
Here is the code, where it crashes:
HtmlFind find = new HtmlFind(Manager.ActiveBrowser.Find.ById("modal"));
HtmlDiv div = new HtmlDiv(find.ByAttributes("class=col-info"));