Hello,
I have a RadMenu on some page. I've added first menu item to my project's elements. But when I perform "Click 'First_Item'" step the action was not performed although the step is marked as passed.
Could you please tell me what is going wrong?
HTML:
<div class="RadMenu RadMenu_Office2007" style="display: inline; visibility: visible; z-index: 7000; overflow: hidden; left: 120px; top: 71px; height: 485px; width: 344px;">
<div style="width: 342px; height: 483px; overflow: hidden; display: block; visibility: visible; top: -485px;" class="rmScrollWrap rmGroup rmLevel1">
<ul class="rmActive rmVertical" style="position: relative; top: 0px; float: left;">
<li class="rmItem rmFirst"><a class="rmLink" href="#" style="width: 342px;"><img class="rmLeftImage" src="../../Images/Icons/site_16.png" alt=""><span class="rmText">My item</span></a></li>
</ul>
<a href="#" style="z-index: 2000; left: 0px; top: 0px;">&nbsp;</a><a href="#" style="z-index: 2000; left: 0px; bottom: 0px;">&nbsp;</a><a href="#" style="z-index: 2000; left: 0px; top: 0px;" class="rmTopArrowDisabled">&nbsp;</a><a href="#" style="z-index: 2000; left: 0px; bottom: 0px;" class="rmBottomArrow">&nbsp;</a></div>
</div>
First_Item found expression:
TagName=li,class=rmitem rmFirst
Thank you in advance
I have a RadMenu on some page. I've added first menu item to my project's elements. But when I perform "Click 'First_Item'" step the action was not performed although the step is marked as passed.
Could you please tell me what is going wrong?
HTML:
<div class="RadMenu RadMenu_Office2007" style="display: inline; visibility: visible; z-index: 7000; overflow: hidden; left: 120px; top: 71px; height: 485px; width: 344px;">
<div style="width: 342px; height: 483px; overflow: hidden; display: block; visibility: visible; top: -485px;" class="rmScrollWrap rmGroup rmLevel1">
<ul class="rmActive rmVertical" style="position: relative; top: 0px; float: left;">
<li class="rmItem rmFirst"><a class="rmLink" href="#" style="width: 342px;"><img class="rmLeftImage" src="../../Images/Icons/site_16.png" alt=""><span class="rmText">My item</span></a></li>
</ul>
<a href="#" style="z-index: 2000; left: 0px; top: 0px;">&nbsp;</a><a href="#" style="z-index: 2000; left: 0px; bottom: 0px;">&nbsp;</a><a href="#" style="z-index: 2000; left: 0px; top: 0px;" class="rmTopArrowDisabled">&nbsp;</a><a href="#" style="z-index: 2000; left: 0px; bottom: 0px;" class="rmBottomArrow">&nbsp;</a></div>
</div>
First_Item found expression:
TagName=li,class=rmitem rmFirst
Thank you in advance
11 Answers, 1 is accepted
0
Hi Nataly,
Is the RadMenuItem you need to click on available at the time of this step execution? There is a small trick recording test against the menus. You sometimes need to manually add a MouseOver step before the click of the item. There are scenarios where a WaitFor element visible is also needed to make sure the Click action can be executed over the visible menu item.
All the best,
Konstantin Petkov
the Telerik team
Is the RadMenuItem you need to click on available at the time of this step execution? There is a small trick recording test against the menus. You sometimes need to manually add a MouseOver step before the click of the item. There are scenarios where a WaitFor element visible is also needed to make sure the Click action can be executed over the visible menu item.
All the best,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Nataly
Top achievements
Rank 1
answered on 17 Aug 2010, 03:09 PM
Hi Konstantin,
I've written the following coded step:
RadMenuItem targetItem = Pages.Page_1.Menu.Find.ByExpression<RadMenuItem>("TextContent=~MyItem");
targetItem.Wait.ForExists(20000);
targetItem.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
targetItem.MouseHover(0, 0, ArtOfTest.Common.OffsetReference.AbsoluteCenter);
targetItem.Click();
But I get the following error on "Wait.ForExists" row:
System.NullReferenceException: Object reference not set to an instance of an object.
Could you please help me to fix the error?
Thank you in advance
I've written the following coded step:
RadMenuItem targetItem = Pages.Page_1.Menu.Find.ByExpression<RadMenuItem>("TextContent=~MyItem");
targetItem.Wait.ForExists(20000);
targetItem.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
targetItem.MouseHover(0, 0, ArtOfTest.Common.OffsetReference.AbsoluteCenter);
targetItem.Click();
But I get the following error on "Wait.ForExists" row:
System.NullReferenceException: Object reference not set to an instance of an object.
Could you please help me to fix the error?
Thank you in advance
0
Hello Nataly,
Since the item still doesn't exist the framework returns 'null', thus the error.
I'd try recording that test first since the test studio performs some useful verifications internally to get the test as complete as possible. If you need to check that code behind you can always convert the successful test steps to code and check how the code looks like.
We also distribute a lot of coded samples that are installed along with the product core. Here is a RadMenu sample test you may find useful:
I hope this helps.
Sincerely yours,
Konstantin Petkov
the Telerik team
Since the item still doesn't exist the framework returns 'null', thus the error.
I'd try recording that test first since the test studio performs some useful verifications internally to get the test as complete as possible. If you need to check that code behind you can always convert the successful test steps to code and check how the code looks like.
We also distribute a lot of coded samples that are installed along with the product core. Here is a RadMenu sample test you may find useful:
[TestMethod]
public
void
ItemsCount()
{
Manager.LaunchNewBrowser();
ActiveBrowser.NavigateTo(
"/menu/examples/programming/addremovedisableitemsclientside/defaultcs.aspx"
);
RadMenu menu = Find.ById<RadMenu>(
"RadMenu1"
);
int
allItemsCount = menu.AllItems.Count;
Assert.AreEqual(24, allItemsCount);
int
rootItemsCount = menu.RootItems.Count;
Assert.AreEqual(2, rootItemsCount);
RadMenuItem itemBooks = menu.FindItemByText(
"Books"
);
itemBooks.Open();
Wait.For<RadMenuItem>(testItem => testItem.Opened ==
true
, itemBooks, 5000);
RadMenuItem itemHistory = menu.FindItemByText(
"History"
);
Assert.AreEqual(
true
, itemHistory.Visible);
Assert.AreEqual(12, itemBooks.Items.Count);
}
I hope this helps.
Sincerely yours,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Nataly
Top achievements
Rank 1
answered on 17 Aug 2010, 03:56 PM
Konstantin,
Thank you for the answer. But both approaches can't be used in my case :(
1. When I recorded the step the tool hasn't recognized menu item as RadMenuItem. The item was added to the project as span. So I can't use converted step for work with RadMenuItem.
2. I've written new coded step:
RadMenuItem targetItem = Pages.Pages.Page_1.Menu.FindItemByText("MyItem");
targetItem.Open();
Wait.For<RadMenuItem>(testItem => testItem.Opened == true, targetItem, 25000);
... and got the following error on the first string:
InnerException:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [$find(\'\').get_allItems()] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: TypeError: 'null' is null or not an object
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'$find(\'\').get_allItems()',ClientId:'Client_87f45c2f-2470-4e87-ae58-ad410c4f37af',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.InvalidOperationException: Javascript call [$find(\'\').get_allItems()] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: TypeError: 'null' is null or not an object
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.
at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
at ArtOfTest.WebAii.Core.Actions.InvokeScript(String script)
at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.InvokeScript(String script)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.GetValue[T](String propertyName, T defaultValue)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.GetValue[T](String propertyName)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.CallMethod(String methodCall)
at Telerik.WebAii.Controls.Html.RadMenu.FindItemByText(String itemText)
Could you please correct my code if something is wrong?
Thank you in advance!
Thank you for the answer. But both approaches can't be used in my case :(
1. When I recorded the step the tool hasn't recognized menu item as RadMenuItem. The item was added to the project as span. So I can't use converted step for work with RadMenuItem.
2. I've written new coded step:
RadMenuItem targetItem = Pages.Pages.Page_1.Menu.FindItemByText("MyItem");
targetItem.Open();
Wait.For<RadMenuItem>(testItem => testItem.Opened == true, targetItem, 25000);
... and got the following error on the first string:
InnerException:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [$find(\'\').get_allItems()] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: TypeError: 'null' is null or not an object
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'$find(\'\').get_allItems()',ClientId:'Client_87f45c2f-2470-4e87-ae58-ad410c4f37af',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.InvalidOperationException: Javascript call [$find(\'\').get_allItems()] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: TypeError: 'null' is null or not an object
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.
at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
at ArtOfTest.WebAii.Core.Actions.InvokeScript(String script)
at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.InvokeScript(String script)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.GetValue[T](String propertyName, T defaultValue)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.GetValue[T](String propertyName)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.CallMethod(String methodCall)
at Telerik.WebAii.Controls.Html.RadMenu.FindItemByText(String itemText)
Could you please correct my code if something is wrong?
Thank you in advance!
0
Hi Nataly,
That is not expected and I'd like to work on that first since the translators are supposed to handle all specific control scenarios.
So do you mean the RadMenu translator doesn't activate for your menu? When you hover over the control and have the highlight mode turned on, do you get the MenuItem -> Menu translators hierarchy? I captured the attached image over the live demo here. Don't you get the same for your menu?
Also what kind of step is that? Did you perform a click action of the item or some sort of verification?
Sincerely yours,
Konstantin Petkov
the Telerik team
That is not expected and I'd like to work on that first since the translators are supposed to handle all specific control scenarios.
So do you mean the RadMenu translator doesn't activate for your menu? When you hover over the control and have the highlight mode turned on, do you get the MenuItem -> Menu translators hierarchy? I captured the attached image over the live demo here. Don't you get the same for your menu?
Also what kind of step is that? Did you perform a click action of the item or some sort of verification?
Sincerely yours,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Nataly
Top achievements
Rank 1
answered on 17 Aug 2010, 04:38 PM
Konstantin,
I have the same elements while mouse over my menu. But when I choose 'RadMenu' or 'RadMenuItem' and click 'Quick tasks' - the tasks are absent. Only empty area is displayed.
On this step I need to find new men item and click it.
P.S. I'm using Telerik.WebUI.TestStudio.QA.2010.2.806 build.
Thank you,
Nataly
I have the same elements while mouse over my menu. But when I choose 'RadMenu' or 'RadMenuItem' and click 'Quick tasks' - the tasks are absent. Only empty area is displayed.
On this step I need to find new men item and click it.
P.S. I'm using Telerik.WebUI.TestStudio.QA.2010.2.806 build.
Thank you,
Nataly
0
Hello Nataly,
Is this application running some old version of RadControls? Or do you get the empty quick tasks over the live demo I pointed you to?
Sincerely yours,
Konstantin Petkov
the Telerik team
Is this application running some old version of RadControls? Or do you get the empty quick tasks over the live demo I pointed you to?
Sincerely yours,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Nataly
Top achievements
Rank 1
answered on 18 Aug 2010, 08:27 AM
Hello Konstantin,
I don't know what version of RadMenu we're using. How can I recognize it?
Quick tasks on demo page are presented.
Is there the way to fix the problem?
Thank you in advance.
I don't know what version of RadMenu we're using. How can I recognize it?
Quick tasks on demo page are presented.
Is there the way to fix the problem?
Thank you in advance.
0
Hi Nataly,
The developers in charge with the application can check the version of the RadControls assembly. You can also check the HTML output looking for comment there. The live demos for example contain the following (latest) version as comment:
Also please check the installation Logs folder for any logged exceptions. There is probably a .txt file containing the logged exception so post some of those here please.
My assumption is this application is running an old RadControls version the latest translators are not compatible with. In such a case you won't be able to benefit from the full power of WebUI Test Studio until the developers upgrade the application to a more recent version.
Regards,
Konstantin Petkov
the Telerik team
The developers in charge with the application can check the version of the RadControls assembly. You can also check the HTML output looking for comment there. The live demos for example contain the following (latest) version as comment:
<!-- 2010.2.713.35 -->
Also please check the installation Logs folder for any logged exceptions. There is probably a .txt file containing the logged exception so post some of those here please.
My assumption is this application is running an old RadControls version the latest translators are not compatible with. In such a case you won't be able to benefit from the full power of WebUI Test Studio until the developers upgrade the application to a more recent version.
Regards,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Nataly
Top achievements
Rank 1
answered on 20 Aug 2010, 01:37 PM
Hi Konstantin,
We're using 2010.1.309.35 version of controls. Is this old version?
Regards,
Nataly
We're using 2010.1.309.35 version of controls. Is this old version?
Regards,
Nataly
0
Hello Nataly,
No, the translators should be fully compatible with this version. That's good news!
At this point it will be best if we can debug the problem over your application under test. Is it possible to grant us access if it is uploaded somewhere? You can submit a private support ticket with any confidential info if needed. We will find what's causing the problem we discuss here and also can take a look at the other issues you need help with.
Greetings,
Konstantin Petkov
the Telerik team
No, the translators should be fully compatible with this version. That's good news!
At this point it will be best if we can debug the problem over your application under test. Is it possible to grant us access if it is uploaded somewhere? You can submit a private support ticket with any confidential info if needed. We will find what's causing the problem we discuss here and also can take a look at the other issues you need help with.
Greetings,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items