Telerik Forums
Test Studio Forum
1 answer
38 views
Hi guys,

I'm trying to build a custom sitemap but having some difficulties.
The sitemap used to work, but now I have pages that require a user to be logged-in first.

If I use the SiteMap.RootNode and the loop through all the children I dont see the "protected" pages.
So then I used the CmsManager.GetPages() which returns all the pages and thats all good, BUT I need the sitemap to display as it displays in the CMS, in that order.

Now it seems like the "Ordinal" value only applies for a group and the pages in the group or something, I have found a thread where it will sort the pages with the ordinal but the menu is still messed-up and not in the order as it is in the cms.

Can anyone help me on how to sort the items so that they will display as in the admin area?

Here is the code I'm using but does not seem to do exactly what I want( I have just added some custom code that will check if a user may see the page, and only then add it to the List ) :


internal class CmsPageComarer : IComparer<ICmsPage>
    {
        #region IComparer<ICmsPage> Members
 
        public int Compare( ICmsPage x, ICmsPage y )
        {
            return x.Ordinal.CompareTo( y.Ordinal );
        }
        #endregion
    }


private List<ICmsPage> GetSource()
        {
            CmsManager manager = new CmsManager();
            IList pages = manager.GetPages();
 
            List<ICmsPage> source = new List<ICmsPage>();
 
            foreach( ICmsPage page in pages )
            {
                string lang = "en";
                if( Request.Url.ToString().ToLower().Contains( "/af/" ) ) lang = "af";
                int langCode = 0;
 
                if( lang.Equals( "en" ) ) langCode = 127;
                if( lang.Equals( "af" ) ) langCode = 54;
 
                if( IsPageVisibleToUser( page ) && page.Navigable && page.LangID == langCode )
                {
                    //show in menu
                    source.Add( page );
                }
            }
 
            CmsPageComarer comparer = new CmsPageComarer();
            source.Sort( comparer );
 
            return source;
        }


internal class CmsPageComarer : IComparer<ICmsPage>
{
#region IComparer<ICmsPage> Members

public int Compare( ICmsPage x, ICmsPage y )
{
return x.Ordinal.CompareTo( y.Ordinal );
}
#endregion



private List<ICmsPage> GetSource()
{
CmsManager manager = new CmsManager();
IList pages = manager.GetPages();

List<ICmsPage> source = new List<ICmsPage>();

foreach( ICmsPage page in pages )
{
string lang = "en";
if( Request.Url.ToString().ToLower().Contains( "/af/" ) ) lang = "af";
int langCode = 0;

if( lang.Equals( "en" ) ) langCode = 127;
if( lang.Equals( "af" ) ) langCode = 54;

if( IsPageVisibleToUser( page ) && page.Navigable && page.LangID == langCode )
{
//show in menu
source.Add( page );
}
}

CmsPageComarer comparer = new CmsPageComarer();
source.Sort( comparer );

return source;
Ivan Dimitrov
Telerik team
 answered on 18 Nov 2010
4 answers
94 views
When I try to open my solution in Visual Studio, I get errors for each test within the solution:

Error loading C:\[filepath]\test.aii: Object reference not set to an instance of an object.

Any ideas what might cause that?
Cody
Telerik team
 answered on 18 Nov 2010
1 answer
114 views
I have recorded some tests and created a test list based on this. When I run this list on my virtual server by logging in via RDC everything is good untill I close my RDC window (not kill the session) just close the RDC window, the tests seem to stop immediately.

I am running these tests on IE browser. What should I do to avoid this problem?  

Keaegan
Telerik team
 answered on 18 Nov 2010
3 answers
304 views
It seems most people are getting this error in FF but I'm seeing it in IE.  I have a form with a <select ... field. The select uses a DHTML based lookup page to find values to populate the select's options - It can contain more than one value thus the select rather than an input field.  When I record the action everything looks fine.  Playing it back from a test list fails with the error shown below.  When I see the playback in the browser it appears that the click that fires the new window never happens.  There are some look ups of this type on a previous page - multi-page, multi-form process.  The previous lookups are for input fields and those work just fine in the playback.

Unable to find the target host (Browser/SilverlightApp) to locate an element. Failure: System.TimeoutException: Wait for condition has timed out
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)
   at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Int32 timeout)
   at ArtOfTest.WebAii.Core.Browser.WaitForFrame(FrameInfo frameInfo, Int32 timeout)
   at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.GetFrameBrowserInstance(Browser topBrowser, FrameInfo frame, Int32 waitTimeout, String& stringError)

Any idea on how to sort this out?

UPDATE ...

Did a little more work with this and found something interesting.  The attached image shows the actual vs the expected.  I'm guessing what's happening is the lookup icon, an image of a maginfying glass, is named the same on both page one - expected - and page 3 - actual.  Since they're in different places on the page(s) and have a different url the application is failing to find it.  This is my assumption of course.  Is this the behavior of the application?  If so, how do I defeat this?  Is there something I'm not seeing?

Thanks,
Todd B.
Cody
Telerik team
 answered on 18 Nov 2010
1 answer
79 views
Hi,

              I have downloaded WebUI test studio for Qa edition and recorded the following test using the recorder in IE.
In my project, I have created a new entry in a grid and saved the entry.
Then I stopped the test and saved it.
While executing the test, it is showing the recorded entry in the grid and this execution is created another duplicate entry in the grid.
Each time an duplicate entry is created in the grid while executing the test.

How to resolve the problem?.

thanks
Keaegan
Telerik team
 answered on 17 Nov 2010
2 answers
78 views
Guys - I recorded a script that basically has a grid. I am adding three lines into the grid. Within the grid I have a RadInput box where I need to feed the numbers. By default the RadInput is loaded with a zero. I am deleting the zero and then typing in the value (eg: 300).

Both the deleting of the zero and the typing of the value is recorded. Now sometimes the script executes as 300 and sometimes it executes as 3000 - what should I do to avoid this? I also set the "Clear Before Typing" property to "True" and there is no change. Sometimes the script executes this as 300 and sometimes as 3000. Again I have recorded deleting of the "0" in the script as well.

Any ideas or best practices to accomplish this?

thanks,

Neeraj
Neeraj
Top achievements
Rank 1
 answered on 17 Nov 2010
4 answers
99 views
A silly little test script i automated with reuse in mind is configured with Close Browser as false (duh).
But, whenever i run it (with the intention of recording the next script) it closes the browser.
What gives?
ME
Top achievements
Rank 1
 answered on 17 Nov 2010
1 answer
65 views
Hi,

          I have recorded a test using the recorder in IE and playback it.
1.Run my application and created an reservation in the Calendar time slot.
2.Saved the test.
3.While playback the test, it shows the reservation in the Calendar timeslot.
  and it opens the Edit popup with the details.

While executing the test, it should show the create popup instead of edit popup.

How to resolve the issue?.

Stoich
Telerik team
 answered on 17 Nov 2010
1 answer
84 views
how to make the area graph start from very left in win forms  i.e the labels of the x axis starts from the (0,0) cordinate
Ves
Telerik team
 answered on 17 Nov 2010
7 answers
223 views
Hello,

I wrote my test and successfully run it in previous version of QA Edition tool.
But when I installed new version (2010.3 1109) and run my test I got the following error:

Selecting item in combo-box'.
InnerException:
System.Exception: Refresh() failed due to an unexpected exception. ---> ArtOfTest.WebAii.Exceptions.FindException: Find Details:
- No FindParams defined.
- Start Element: [Element: 'div:46' (id=GroupSelector_comboGroup)]


   at ArtOfTest.WebAii.ObjectModel.Element.Refresh()
   --- End of inner exception stack trace ---
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh()
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh(Boolean forceDomTreeRefresh)
   at ArtOfTest.WebAii.Controls.Control.Refresh()
   at Telerik.WebAii.Controls.Html.RadComboBoxItem.Select()
   at Pr.Test1.Test1_CodedStep13() in c:\Documents and Settings\Administrator\Desktop\Pr\Test1.aii.cs:line 287

CodedStep13:

            RadComboBoxItem groupNew=Pages.Proj_0.Frame1.GroupSelectorComboDiv.Find.ByExpression<RadComboBoxItem>("TextContent="+newGroup);
            groupNew.MouseHover();
            groupNew.Select();

Could you, please tell how to fix it?

Thanks
Helen
Telerik team
 answered on 16 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?