or
foreach (RadMenuItem rootitem in menu.RootItems)
{
string menuHeader = rootitem.Text;
Log.WriteLine("The menu header is - " + menuHeader);
RadMenuItem menuList = menu.FindItemByText(menuHeader);
foreach (RadMenuItem childitem in menuList.Items)
{
string chldItem = childitem.Text;
Log.WriteLine(menuHeader + " - " + chldItem);
if (childitem.HasChildren)
{
int c = childitem.ChildNodes.Count;
for (int i = 1; i <= c; i++)
{
string childChild = ****CAN'T FIGURE THIS CODE OUT****
Log.WriteLine(menuHeader + " - " + chldItem + " - " + childChild);
}
}
}
}
using
System;
using
System.Text;
using
System.Collections.Generic;
using
System.Linq;
using
Microsoft.VisualStudio.TestTools.UnitTesting;
using
ArtOfTest.WebAii.Core;
using
ArtOfTest.WebAii.TestTemplates;
using
ArtOfTest.WebAii.Extensions;
using
ArtOfTest.WebAii.Silverlight;
using
ArtOfTest.WebAii.Silverlight.UI;
using
ArtOfTest.WebAii.Silverlight.Attributes;
using
ArtOfTest.Common;
using
ArtOfTest.WebAii.Controls.Xaml;
using
ArtOfTest.WebAii.Controls.HtmlControls;
namespace
TestProject7
{
[TestClass]
public
class
UnitTest1
{
public
UnitTest1()
{
}
private
TestContext testContextInstance;
public
TestContext TestContext
{
get
{
return
testContextInstance;
}
set
{
testContextInstance = value;
}
}
[TestMethod]
public
void
TestMethod1()
{
Settings mySettings =
new
Settings();
mySettings.Web.DefaultBrowser = BrowserType.Chrome;
mySettings.ClientReadyTimeout = 120000;
Manager myManager =
new
Manager(mySettings);
//must start myManager after creating it
myManager.Start();
try
{
Settings.Current.Web.EnableSilverlight =
true
;
mySettings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
myManager.LaunchNewBrowser();
myManager.ActiveBrowser.NavigateTo(
"http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html"
);
myManager.ActiveBrowser.WaitUntilReady();
SilverlightAppsList apps = myManager.ActiveBrowser.SilverlightApps();
SilverlightApp app = apps.ToArray()[0];
string
ok =
"I am glad if this is executed :)"
;
}
catch
(Exception e)
{
myManager.Dispose();
}
}
}
}
Hello.
i run my tests with jenkins configured building and running tests on remote computer.
tests all ok but each test throw exception
Internal error: An unhandled exception occurred. The exception occurred while test step 'test10' was running. System.Threading.ThreadAbortException: Thread was being aborted. at ArtOfTest.WebAii.Messaging.Process.BrowserRemoted.AsyncListenerThreadEntry() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() |
string
style =
new
HtmlControl(element).GetComputedStyleValue(
"font-family"
);
string
script = @
"function getstyle() {var el = document.getElementById('"
+ element.IdAttributeValue +
"');"
+
"var computedStyles = window.getComputedStyle(el, null);\n"
+
"return computedStyles.getPropertyValue('font-family')}\n getstyle()"
;
style = Actions.InvokeScript<
string
>(script);