Hi,
We are implementing generic functions for click operations on the Silver light objects.
But, we are unable to write the proper code in C#, please refer below code and help.
We have tried below functions without any success.
1. myManager.ActiveBrowser.Find.ByName<HtmlControl>(objID).Click(); -- Not working
myManager.ActiveBrowser.SilverlightApps()[0].RefreshVisualTrees();
2. myManager.ActiveBrowser.SilverlightApps()[0].Find.ByExpression(@"XamlPath=/grid[name=RootElement]/border[name=ChartBorder]/grid[name=ChartAreaGrid]/grid[name=CenterOuterGrid]/grid[name=CenterGrid]/grid[name=CenterInnerGrid]/grid[name=PlotAreaGrid]/scrollviewer[automationid=PlotAreaScrollViewer]/border[0]/grid[0]/scrollcontentpresenter[name=ScrollContentPresenter]/canvas[name=PlotCanvas]/canvas[name=DrawingCanvas]/canvas[0]/canvas[0]/canvas[0]/canvas[0]/path[12]",true).User.HoverOver();
3. myManager.ActiveBrowser.SilverlightApps()[0].Find.ByType<ArtOfTest.WebAii.Silverlight.UI.Path>('Uid="66208306"').User.HoverOver(); -- Not Working..
3. This works when we hover manually on the silver light object to fetch the tool tip value.
string myToolTipVal = STEPForTestStudioclass.myManager.ActiveBrowser.SilverlightApps()[0].Find.ByAutomationId<TextBlock>("ToolTipTextBlock").TextContent; --> Works fine.
But we need some generic function which will click when we pass the object ID/name/Automation ID of the silver light control.
FYI: While recording and play back it works fine, but we don't want to use that descriptive code but would like to create
some generic functions if possible.
Regards
Tapan
We are implementing generic functions for click operations on the Silver light objects.
But, we are unable to write the proper code in C#, please refer below code and help.
We have tried below functions without any success.
1. myManager.ActiveBrowser.Find.ByName<HtmlControl>(objID).Click(); -- Not working
myManager.ActiveBrowser.SilverlightApps()[0].RefreshVisualTrees();
2. myManager.ActiveBrowser.SilverlightApps()[0].Find.ByExpression(@"XamlPath=/grid[name=RootElement]/border[name=ChartBorder]/grid[name=ChartAreaGrid]/grid[name=CenterOuterGrid]/grid[name=CenterGrid]/grid[name=CenterInnerGrid]/grid[name=PlotAreaGrid]/scrollviewer[automationid=PlotAreaScrollViewer]/border[0]/grid[0]/scrollcontentpresenter[name=ScrollContentPresenter]/canvas[name=PlotCanvas]/canvas[name=DrawingCanvas]/canvas[0]/canvas[0]/canvas[0]/canvas[0]/path[12]",true).User.HoverOver();
3. myManager.ActiveBrowser.SilverlightApps()[0].Find.ByType<ArtOfTest.WebAii.Silverlight.UI.Path>('Uid="66208306"').User.HoverOver(); -- Not Working..
3. This works when we hover manually on the silver light object to fetch the tool tip value.
string myToolTipVal = STEPForTestStudioclass.myManager.ActiveBrowser.SilverlightApps()[0].Find.ByAutomationId<TextBlock>("ToolTipTextBlock").TextContent; --> Works fine.
But we need some generic function which will click when we pass the object ID/name/Automation ID of the silver light control.
FYI: While recording and play back it works fine, but we don't want to use that descriptive code but would like to create
some generic functions if possible.
Regards
Tapan