Can't determine if a certain UITestControl exists in my web app

前端 未结 3 1347
清酒与你
清酒与你 2020-12-17 22:29

I\'m currently trying to help automate some coded UI tests using C# for a web application. A frequent problem I\'m encountering is that it can be extremely difficult to det

3条回答
  •  無奈伤痛
    2020-12-17 23:05

    Instead of using obj.Exists() we have coded our own exists method that uses a combination approach of EnsureClickable() and BoundingRectangle.Width>0 to make sure that the control has a screen point.

    ETA- oops, sorry left off an important part. Updated to add .Width to make sure it's greater than 0, you may need to use length if you width is somehow not working.

提交回复
热议问题