This is a migrated thread and some comments may be shown as answers.

[Solved] WebAii RadControl wrappers

7 Answers 114 Views
ASP.NET AJAX WebAii RadControls
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Atomstodin.is
Top achievements
Rank 1
Atomstodin.is asked on 21 Jul 2009, 10:08 AM


Hi,

I have recently downloaded (from this URL http://www.telerik.com/account/downloads.aspx) and installed the WebAii framework but can't seem to find the RadControls wrappers.  Could you tell me where to download them from?

Best  Regards,
Oli

7 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 21 Jul 2009, 10:19 AM
Hi Oli,

The RadControls Wrappers are installed along with the WebAii framework. To make sure you already have them installed just take a look at your usual Program Files/Telerik folder (in case you haven't chosen another install path from the setup) as well as at Global Assembly Cache. The assemblies you should look for are:
  • Telerik.WebAii.Controls.Html - RadControls for ASP.NET AJAX wrappers
  • Telerik.WebAii.Controls.Xaml - RadControls for Silverlight wrappers

The current version is 2009.2.701.20.

You can also run the Visual Studio 2008 Sample Tests solution from the start menu shortcut under the Telerik folder. The projects (either ASP.NET or Silverlight) are ready to be compiled. Once you build them you can choose the tests you want to run in Visual Studio Test View for example.

Let us know if further assistance is needed.

Regards,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Atomstodin.is
Top achievements
Rank 1
answered on 21 Jul 2009, 11:30 AM
Hi,

Found them!  Thanks for the quick reply.

Regards,
Oli
0
Peterson
Top achievements
Rank 1
answered on 25 Aug 2009, 12:19 PM
Hi all,
I use WebAii RadControl wrapper as the following:
       RadListBox listBox1 = Find.ById<RadListBox>("ctl00_DefaultContent_lstAvailableFields");
       RadListBoxItem item_Session = listBox1.Items[2];

The "ctl00_DefaultContent_lstAvailableFields" is a rad list box :

<div  id="ctl00_DefaultContent_lstAvailableFields"   class="RadListBox RadListBox_Default RadListBoxScrollable "
style="height: 300px; width: 250px; >
            
....
</div>



But  i can't reach to line code 2 and system returns the msg:
 "Telerik.WebAii.Controls.Html.Tests.ListBox.ListBoxTests.DragAndDropToListBox1:
  System.NullReferenceException : Object reference not set to an instance of an object."
I tried to check that the listbox control is existed  or not as :
               string element=Find.ById<RadListBox>("ctl00_DefaultContent_lstAvailableFields").ToString();
               System.Console.WriteLine("List box 1: "+element);
But the error still appear, it seems the listBox1 didn't success but i don't know reason why.
Could you please help me solve it?
Thank you in advance,
Son
0
Missing User
answered on 25 Aug 2009, 05:57 PM
Hi Son Vo,

I tried the latest version of the testing Framework against this demo page. From the demo page source, the List Box is similar to the code you posted, so I used your test code with a change in the ID and it worked for the demo on this end.

In the above case, the List Box is on the page itself, so it can be found on the ActiveBrowser using just 'Find.ById...'.  If your List Box is in a frame, you would need to find the frame in the frame collection like the following:

Browser frame = ActiveBrowser.Frames[0];  
// Or use ActiveBrowser.Frames.ById or ActiveBrowser.Frames.BySrc  
RadListBox listBox1 = frame.Find.ById<RadListBox>("ctl00_DefaultContent_lstAvailableFields");  
RadListBoxItem item_Session = listBox1.Items[2]; 

If there is any dynamic changes to the DOM when displaying the List Box, you can call ActiveBrowser.RefreshDomTree(); to update the Frameworks view of the DOM when the List Box becomes visible as in:

ActiveBrowser.RefreshDomTree();  
RadListBox listBox1 = Find.ById<RadListBox>("ctl00_DefaultContent_lstAvailableFields");  
RadListBoxItem item_Session = listBox1.Items[2]; 
 
You can do likewise with the frames using Frames.RefreshAllDomTrees();

If none of these options work or are applicable, could you then please post your complete test code for us to look at? Also, would your page be available to view online? If not, would it then be possible for you to send your page with enough of it's dependencies for us to test against? There may be more to your page that we would need to look at to debug the problem. 

Greetings,
Nelson Sin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Peterson
Top achievements
Rank 1
answered on 26 Aug 2009, 04:30 AM
Hi Nelson,
Thank for your response . Base on your suggestion i found that the page use a RadWindowManager, at fisrt  it will load a ribbon , then when you click on a ribbon ,a pop  up will open .The pop up will contain the radlistbox . So , my code can't  catch the pop up and it still focus on on the first  page. I think that is my issue and i will work around on this . This is my code:
try 
           { 
               Manager.LaunchNewBrowser(); 
               ActiveBrowser.NavigateTo(settings.BaseUrl); 
 
               HtmlAnchor linkCreateNew = Find.ByXPath<HtmlAnchor>("//div [@class='block sessions']/ul/li/a"); 
               linkCreateNew.Click(); 
 
               //Wait for Image ("//img[@alt='Select and order report fields']"); 
               HtmlImage imgOrder = Find.ByXPath<HtmlImage>("//img[@alt='Select and order report fields']"); 
               imgOrder.Wait.ForExists(); 
 
               // Set new browser tracking to enabled. 
               // This will make all new browser instances connect to 
               // the Manager. 
               Manager.SetNewBrowserTracking(true); 
 
               // Click the image on the ribbon to open the popup 
            
                imgOrder.Click(); 
               // Wait for the new browser instance 
                Thread.Sleep(1000); 
               Manager.SetNewBrowserTracking(true); 
 
               Console.WriteLine("Browser:"+Manager.Browsers.Count.ToString()); 
              
               Thread.Sleep(1000); 
               ActiveBrowser.RefreshDomTree();  
               RadListBox listBox1 = Find.ById<RadListBox>("ctl00_DefaultContent_lstAvailableFields"); 
               string element=Find.ById<RadListBox>("ctl00_DefaultContent_lstAvailableFields").ToString(); 
               System.Console.WriteLine("List box 1: "+element); 
               RadListBox listBox2 = ActiveBrowser.Find.ById<RadListBox>("ctl00_DefaultContent_lstSelectedFields"); 
 
               RadListBoxItem item_Session = listBox1.Items[2]; 
               item_Session.Select(); 
 
               System.Console.WriteLine("Item 0 value::" + listBox1.Items[2].Text); 
               HtmlDiv destDiv = ActiveBrowser.Find.ById<HtmlDiv>("ctl00_DefaultContent_lstSelectedFields"); 
 
               Point destPoint = new Point(destDiv.GetRectangle().X + destDiv.GetRectangle().Width / 2, destDiv.GetRectangle().Y + destDiv.GetRectangle().Height / 2); 
               item_Session.DragTo(destPoint); 
               Wait.For<RadListBox>(myListBox => myListBox.Items.Count == 1, listBox2, 10000); 
               Thread.Sleep(10000); 
           } 
           catch (AssertionException e) 
           { 
               Assert.Fail(Convert.ToString(e)); 
               Console.WriteLine(Convert.ToString(e)); 
           } 
            
 

But  i count the browser ,  as the following code " Console.WriteLine("Browser:"+Manager.Browsers.Count.ToString()); "-> It still 1 , it means I can't focus to the popup and catch the element on this pop up. And finally , i still stuck with it. Could you please help me advise some?
Many thanks,
Son
0
Peterson
Top achievements
Rank 1
answered on 26 Aug 2009, 08:54 AM
Hi Nelson,
Actually, the page uses an Iframe to open a html pop up . So, I used solution and it works well .
Once again, thank for your solution.
Many thanks,
Son.
0
Missing User
answered on 26 Aug 2009, 06:53 PM
Hello again Peterson,

I'm glad you were able to get your test code working. I'll go ahead and close this thread, but feel free to create new posts if you encounter any other issues

Best wishes,
Nelson
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ASP.NET AJAX WebAii RadControls
Asked by
Atomstodin.is
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Atomstodin.is
Top achievements
Rank 1
Peterson
Top achievements
Rank 1
Missing User
Share this question
or