or
[Test]
public
void
SimpleTest()
{
Manager.LaunchNewBrowser();
ActiveBrowser.WaitUntilReady();
ActiveBrowser.Window.Maximize();
ActiveBrowser.NavigateTo(MyServerUrl);
var headerItems =
new
HeaderItems(MySilverlightApp);
headerItems.ReportsNavigationButton.User.Click();
}
...
[16:34] - Unable to load ArtOfTest.Connector.dll
[16:34] - Exception Details:
[16:34] - ------------------
[16:34] - System.ArgumentNullException: Wartość nie może być zerowa.
Nazwa parametru: ptr
w System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)
w ArtOfTest.Common.Win32.WindowManager..cctor()
System.NullReferenceException : Odwołanie
do
obiektu nie zostało ustawione na wystąpienie obiektu.
w IFin24App.WebAii.ApplicationElements.HeaderItems.get_ReportsNavigationButton() w HeaderItems.cs: line 53
...
[Test]
public
void
GoogleTest()
{
ActiveBrowser.NavigateTo(
"http://www.google.com"
);
ActiveBrowser.WaitUntilReady();
HtmlInputText queryBox = Find.ByName<HtmlInputText>(
"q"
);
Desktop.Mouse.Click(MouseClickType.LeftClick, queryBox.GetRectangle());
Desktop.KeyBoard.TypeText(
"sample"
, 1000);
Actions.Click(Find.ById(
"btnG"
));
}
Settings mySettings =
new
Settings(BrowserType.InternetExplorer, @
"c:\log\"
);
mySettings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
Manager myManager =
new
Manager(mySettings);
myManager.Start();
myManager.LaunchNewBrowser();
myManager.ActiveBrowser.NavigateTo(
"http://vkontakte.ru/login.php"
);
//That's the "Login" button.
Element link;
link = myManager.ActiveBrowser.Find.ByXPath(
"//td/*/*/*/*/a[1]"
);
HtmlControl lnk =
new
HtmlControl(link);
String weight = lnk.GetComputedStyleValue(
"fontWeight"
);
String style = lnk.GetComputedStyleValue(
"fontStyle"
);
String size = lnk.GetComputedStyleValue(
"fontSize"
);
Console.WriteLine(myManager.ActiveBrowser.BrowserType);
Console.WriteLine(
"Size: {0}"
, size);
Console.WriteLine(
"Weight: {0}"
, weight);
Console.WriteLine(
"Style: {0}"
, style);
myManager.Dispose();
FireFox
Size: 11px
Weight: 400
Style: normal
InternetExplorer
Size: 11px
Weight:
Style: normal