The playback failed to find the control with the given search properties in Coded UI

前端 未结 3 2061
借酒劲吻你
借酒劲吻你 2021-01-16 08:53

I\'m new in Coded UI test, so here\'s a \"simple\" question:

Trying to navigate through the options of a menu, i\'ve recorded actions nad tried to playback. I got th

3条回答
  •  不知归路
    2021-01-16 09:02

    Go into the UI map and change the FilterProperty for InnerText to a SearchProperty. Search properties are applied first -- if it finds one exact match, it doesn't even look at Filter properties. In this case, the most important thing about the control (the text value) is a filter property.

    It's trying to find a

  • tag with no ID. It undoubtedly finds multiple matches. Then it applies the filter properties, which are probably things that vary from page load to page load.

    You could also apply an ID property to the

  • tags, then update the UI map search properties so that it searches for that specific ID, which would also solve the problem.

    In general, when you're using Coded UI with web applications, it's a good idea to make sure everything on the page has a unique "ID" attribute. This makes it much easier for Coded UI to zero in on the page elements you're trying to interact with.

提交回复
热议问题