Hi,
> "[..] believe" and "[..] should work [..]" comments to get a better community rank is absolutley not very helpful.
One friend of mine somewhere in time had fantastic phrase in his avatar:
"All extreme judgements are ultimately wrong. Even this one seems to be too extreme."
> Try to execute my example code, when it works on your machine, just say "[..] works on my machine [..]"
a) I am not employed by SmartBear;
b) This is public Community forum where you are welcome to ask questions but nobody owes you anything and well may decide not to spend his time to execute some piece of code without clear description of what goes wrong;
c) One of the best ways during evaluation is to contact Support for guaranteed and official reply. Support can be contacted via the https://support.smartbear.com/message/?prod=TestLeft form;
d) Been an end-user and a tester, I do not much care about something that works on someone's machine. The fact that something works on my machine means nothing to you. That is why I wondered about your exact problems in order to try to help;
e) It's a pity that your company cancelled evaluation as it looks like that the one who evaluated TestLeft just did not read documentation and did not went through provided code samples;
f) My experience with C# is really basic but the below two test methods created with the help of TestLeft's UI Spy "worked on my machine" :
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SmartBear.TestLeft;
using SmartBear.TestLeft.TestObjects;
using SmartBear.TestLeft.TestObjects.WPF;
namespace VSMenuTest
{
[TestClass]
public class TestLeftTest : UnitTestClassBase
{
#region Class initializers
[ClassInitialize]
public static void ClassInitialize(TestContext context)
{
UnitTestClassBase.InitializeClass(context);
}
[ClassCleanup]
public static void ClassCleanUp()
{
UnitTestClassBase.FinalizeClass();
}
#endregion
[TestMethod]
public void VSMenuTest()
{
IControl vsMenuItem = Driver.Find<IProcess>(new ProcessPattern()
{
ProcessName = "devenv"
}).Find<IControl>(new WPFPattern()
{
ClrFullClassName = "Microsoft.VisualStudio.PlatformUI.MainWindow"
}, 2).Find<IWPFMenu>(new WPFPattern()
{
WPFControlAutomationId = "MenuBar"
}).Find<IControl>(new WPFPattern()
{
ClrFullClassName = "Microsoft.VisualStudio.PlatformUI.VsMenuItem",
WPFControlText = "_File"
});
vsMenuItem.Click();
IControl vsMenuItem2 = Driver.Find<IProcess>(new ProcessPattern()
{
ProcessName = "devenv"
}).Find<IControl>(new WPFPattern()
{
ClrFullClassName = "System.Windows.Controls.Primitives.PopupRoot"
}, 2).Find<IControl>(new WPFPattern()
{
ClrFullClassName = "Microsoft.VisualStudio.PlatformUI.VsMenuItem",
WPFControlText = "_New"
}, 3);
vsMenuItem2.Click();
IControl vsMenuItem3 = Driver.Find<IProcess>(new ProcessPattern()
{
ProcessName = "devenv"
}).Find<IControl>(new WPFPattern()
{
ClrFullClassName = "Microsoft.VisualStudio.PlatformUI.VsMenuItem",
WPFControlText = "_Project..."
}, 6);
vsMenuItem3.Click();
ITopLevelWindow hwndSource = Driver.Find<IProcess>(new ProcessPattern()
{
ProcessName = "devenv"
}).Find<ITopLevelWindow>(new WindowPattern()
{
WndCaption = "New Project"
});
hwndSource.Close();
}
[TestMethod]
public void VSMenuTest2()
{
ITopLevelWindow hwndSource = Driver.Find<IProcess>(new ProcessPattern()
{
ProcessName = "devenv"
}).Find<ITopLevelWindow>(new WindowPattern()
{
WndCaption = "*Microsoft Visual Studio"
});
hwndSource.Keys("^!N");
ITopLevelWindow hwndSource2 = Driver.Find<IProcess>(new ProcessPattern()
{
ProcessName = "devenv"
}).Find<ITopLevelWindow>(new WindowPattern()
{
WndCaption = "New Project"
});
hwndSource2.Close();
}
}
}
P.S.: BTW, thank you for your message - it made me to start VisualStudio and refresh my memory as for how C# looks like. Something that I was going to do for some time but did not have a good enough reason. :)