Tuesday, January 25, 2011

Handle JavaScript dialog using WebAii

In order to handle JavaScript dialog using WebAii I used following command

manager.DialogMonitor.AddDialog(new AlertDialog(manager.ActiveBrowser,DialogButton.OK)); // Dialog which clicks on OK button

manager.DialogMonitor.Start();

manager.ActiveBrowser.Actions.Click(Element) // Click on link

Wednesday, January 19, 2011

Test Fixtures in Visual Studio Unit Testing Framework

Today I learned that,

[ClassInitialize()] fixture in VS Test Framework is [TestFixtureSetUp] in NUnit
and
[ClassCleanup()] fixture in VS Test Framework is [TestFixtureTearDown] in NUnit

Tuesday, January 18, 2011

Find silverlight element using XamlPath

In order to find Silverlight element using WebAii by XamlPath expression I used following syntax

FrameworkElement myElement = app.Find.ByExpression(new XamlFindExpression("Name=TabsContainer", "XamlTag=grid", "|", "XamlPath=/radtabcontrol[automationid=Tabs]/grid[0]/raddockpanel[0]/layouttransformcontrol[name=HeaderDockedElement]/grid[name=RootVisual]/contentpresenter[name=ContentPresenter]/grid[0]/raddockpanel[0]/scrollviewer[automationid=ScrollViewerElement]/border[0]/grid[0]/scrollcontentpresenter[name=ScrollContentPresenter]/itemspresenter[0]/tabwrappanel[0]/radtabitem[0]"));