windowsForm.EnsureVisible(); TdTag setupTag = windowsForm.FindSingle<TdTag>(new RxPath(".//td[@InnerText~'Setup']"),new Duration(90000)); setupTag.Click();This code works but not in the cmdlet.
Platform: XP Pro with SP3
Ranorex Version: 2.1.0.6243
windowsForm.EnsureVisible(); TdTag setupTag = windowsForm.FindSingle<TdTag>(new RxPath(".//td[@InnerText~'Setup']"),new Duration(90000)); setupTag.Click();This code works but not in the cmdlet.
Code: Select all
Thread newThread = new Thread(delegate()
{
SetUpDefaultParameters();
adapter = DelegateAction();
});
newThread.SetApartmentState(ApartmentState.STA);
newThread.Start();
// Wait for newThread to start and go to sleep.
newThread.Join();
Code: Select all
protected override Adapter DelegateAction()
{
Ranorex.MenuItem menuItem = null;
try
{
menuItem = container.FindSingle<Ranorex.MenuItem>(new RxPath(".//menuitem[@accessiblename~'" + name + "']"),
new Duration(timeOut));
menuItem.EnsureVisible();
menuItem.Click();
}
catch (ElementNotFoundException ex)
{
exceptionInformation = ex.ToString();
}
return menuItem;
}
In your code, you set the menu item 'NULL' before try to find the element. If the element could not found, the 'ElementNotFoundException' will be called. You ignore the exception and return menu item ('NULL').For some reason I keep getting a blank menu item
catch (ElementNotFoundException ex) { Report.Error(ex.ToString()); Report.Screenshot(); Report.End(); }So you can see in Report, why the menu item could not be found.