为对象库元素建立一组Adapter

如果一个对象库中的元素的RanoreXPath对应界面上的多个元素,你可以使用CreateAdapters方法来建立一组adapter .

C#

// Create a list of adapters using the "Info" object IList<Ranorex.Button> buttonList = repo.MyApp.EnabledButtonsInfo.CreateAdapters<Ranorex.Button>();

// Move the mouse pointer to each button of the list // and add a screenshot for each to the report foreach (Ranorex.Button button in buttonList ) { button.MoveTo(); Report.Screenshot(button); }

VB.NET

' Create a list of adapters using the "Info" object Dim buttonList As IList(Of Ranorex.Button) = repo.MyApp.EnabledButtonsInfo.CreateAdapters(Of Ranorex.Button)()

' Move the mouse pointer to each button of the list ' and add a screenshot for each to the report For Each button As Ranorex.Button In buttonList button.MoveTo() Report.Screenshot(button) Next

了解更多关于如何让一个对象库中的项对应多个元素:为多个元素指定同一个对象库项

posted @ 2016-04-10 20:18  老夫子_22  阅读(112)  评论(0)    收藏  举报