Telerik Forums
Testing Framework Forum
1 answer
118 views

Hello,

I have to launch my Silverlight application for automating my testing, I am now working with Internet Browser for now, but I ideally need to automate my testing by initiating the desktop link to of Silverlight application to test. I have tried couple of options posted in some the following links..

 

http://www.telerik.com/automated-testing-tools/support/kb/using-telerik-testing-framework-with-silverlight-out-of-browser-and-elevated-trust.aspx

 

http://www.telerik.com/automated-testing-tools/community/forums/test-studio-express/automation-framework/silverlight-out-of-browser-in-webaii-2010-2.aspx

 

I hope I am missing something…Please help me on the same…

 

Find my desktop link properties::

"C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe" 846926624.localhost

 

Code Below:

 

//ABI

        [TestMethod]

        public void SilverlightApplicationFileUploadExample4()

        {

            var settings = GetSettings();

            settings.EnableSilverlight = true;

            Window buttonToClick = null;

 

            Initialize(settings, Console.WriteLine);

            Manager.Settings.ExecutionDelay = 10;

            //Manager.LaunchNewBrowser(BrowserType.InternetExplorer);

 

            //ActiveBrowser.NavigateTo("http://localhost/Web/FieldClaims.aspx");

 

            Manager.LaunchNewBrowser(BrowserType.SilverlightOutOfBrowser, true, System.Diagnostics.ProcessWindowStyle.Minimized, "846926624.localhost"); //Fails here with Script Error

       

          }

Stoich
Telerik team
 answered on 11 Aug 2011
5 answers
114 views
Hello.

Use this code:
var bro = Manager.Current.ActiveBrowser;
var frame = bro.Frames["my_frame"];
frame.RefreshDomTree();
             
var rect = frame.Find.ById("my_div").GetRectangle();
Manager.Current.Desktop.Mouse.Click(MouseClickType.LeftClick, rect);

and these pages:

1.html
<iframe name="my_frame" src="2.html" style="position: absolute; width: 200px; height: 200px; top: 300px; left: 300px;">

2.html
<div id="my_div" onclick="alert(1)" style="margin: 40px; width: 30px; height: 30px; background: red"></div>


In FF4 it clicks outside the frame... and nothing works
Stoich
Telerik team
 answered on 09 Aug 2011
8 answers
481 views
help I am just trying to build this c# examle:
http://www.artoftest.com/support/webaii/topicsindex.aspx

and I am getting the following error:
The type or namespace name 'Manager' could not be found (are you missing a using directive or an assembly reference?) 


I have "ArtOfTest.Common" and "ArtOfTest.WebAii" referenced and I did resolve on the 'Manager object' and it add this declaration to my code:

using

 

 

ArtOfTest.WebAii.Core;

yet it will still not build, and I missing a ref?

 




Cody
Telerik team
 answered on 08 Aug 2011
1 answer
66 views
Hi,

i caputured a test with IE 9. Now i want to run the same test with Firefox 5.0.1. The test always fails because the "Handle 'Alert' dialog runs in a timeout.

What can be the problem?

Thanks
Anthony
Telerik team
 answered on 05 Aug 2011
3 answers
2.0K+ views
I would think this would be simple.  Trying to test a web page which contains a RadListBox I'm able to get it just fine.   The problem appears nothing indicates what is  selected in the list.  I would think SelectedIndex or SelectedItem would work but both are useless.

My code:

        public string GetSelectedItem(HtmlDiv parentElement, string controlID)
        {
            RadListBox theListbox = parentElement.Find.ById<RadListBox>(controlID);
            
            //  proof the code is getting the list box and can get a RadListBoxItem...
            for( int idx = 0; idx < theListbox.ChildNodes.Count(); idx++ )
            {
                RadListBoxItem  li = theListbox.ChildNodes[idx];
                string xx = li.TextContent;
            }

            // only after this:
            return theListbox.ChildNodes[theListbox.SelectedIndex].TextContent ;
        }

And going further i would think if I'm able to get a ListBoxItem, while interating through the for loop testing if a given item has the text that i would like to set, when the time come i thought i would need to do something like:

public Boolean SetSelectedItem(HtmlDiv parentElement, string controlID)
{
            RadListBox theListbox = parentElement.Find.ById<RadListBox>(controlID);
            
            //  proof the code is getting the list box and can get a RadListBoxItem...
            for( int idx = 0; idx < theListbox.ChildNodes.Count(); idx++ )
            {

                RadListBoxItem  li = theListbox.ChildNodes[idx];
                if( li.TextContent.Equals( "???) )
                {
                        li.Selected = true;
                        // or
                        theListBox.SelectedItem = li;
                        //
                        theListBox.SelectedIndex = idx;
                       return true;
            }
            return false;
}

But nothing seems to be working and the SelectedItem and SelectedIndex are both read only.  

Any suggestions.   This seems simple, but couldn't find any samples on here or documentation for the Art Of Test or Telerik controls which i've seen that is useful.  Any suggestions are welcome.

            // only after this:
            return theListbox.ChildNodes[theListbox.SelectedIndex].TextContent ;
        }
Helen
Telerik team
 answered on 05 Aug 2011
10 answers
173 views
Hi,

We have a requirement to test a editbox; to enter a test string of length>16
[editbox should accept a string with a max length of 16 only]

i am using htmlinputText.Text = "some value i would enter here";
it's accepting the strings whose length is more than 16.

where as the same editbox doesnot accept string of length more than 16 when we "actually type in".

Please help.

thanks and regards,
Kiran K N
Cody
Telerik team
 answered on 02 Aug 2011
6 answers
111 views
Hi,

After installing Telerik.WebAii.Framework.2010.3.1607.msi

There is folder C:\Program Files (x86)\Telerik\WebAii Testing Framework 2010.3\Browser Extensions, it contains 4 other folders:
. Chrome
. Firefox
. Firefox4
. Safari


What is the purpose of these folders?

Thanks,
San
Cody
Telerik team
 answered on 02 Aug 2011
4 answers
191 views

Hi Team,

I am stuck in the following area since couple of days.

We are implementing Keyword framework with Test Studio and we are facing few issues while implementing the silver light Keywords.

In our excel sheet we are passing the Parent object before accessing the underlying object in a particular page.

 

Now to access the Parent element we need to create a string as shown below and execute it.

But we are unable to execute the string or know how to create proper string.

 

Pages + "." + pageName + "." + Find.ByName<HtmlInputText>(objID).Text = inputData;

 

In Visual studio it is giving error as “An object reference is required for non static field method or property “ArtOfTest.webAii.Core.Find.ByName<TControl>(String)”

Please let us know how to resolve this issue.We tried several ways by referring samples posted in the net,
e.g. http://social.msdn.microsoft.com/Forums/eu/csharpgeneral/thread/f248d774-0918-4f68-a0c6-23aa29a7ae29
But after doing any modifications @ above link/code we are not able to execute it successfully.

Please help or let us know if there is some other way to resolve the issue.

Regards,

Tapan

mints
Top achievements
Rank 1
 answered on 02 Aug 2011
1 answer
80 views
I am having trouble getting telerik to handle a download-->save operation ...where a window opens allowing the user to browse to the directory where the downloaded file is to be saved and also enter the name of the downloaded file. Also , should the download-save operation take a long while, how can I get the recording to patiently wait until the save completes? Has anyone  encountered these kinds of issues before? any examples you cah offer up?  THanx!
Anthony
Telerik team
 answered on 01 Aug 2011
2 answers
980 views
Hi,

I am running test framework 2010.3.1109.  I have the same issue when I tried version 2011.1.609.  I am using TeamCity and nunit to run the automation tests.

We typically run a set of 3 to 7 tests (one story) and then shutdown the browser for a clean start on the next story's tests.

Chrome runs fine.  However both IE 8 and FireFox 3.6 exhibit the following problems:

Whenever we shut down the browser by calling ShutDown() we get this exception: System.Threading.ThreadAbortException: Thread was being aborted The tests continue to run.  However eventually we get the following exception: System.IO.IOException: All pipe instances are busy At this point the browsers open but do not navigate to the starting URL.

My guess is that the aborted threads are leaving a pipe instance open, and that eventually the server runs out of pipes.
I can handle the problem by putting in a sleep after each shutdown.  However this adds a lot of time to our tests.  In some cases I need a sleep as long as 30 seconds.  At least I think this will handle the problem.  I am trying the 30 second sleep now.  Also the ThreadAbortExceptions clutter the logs.

Are there any better solutions?

Rob

Rob
Top achievements
Rank 1
 answered on 01 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?