Telerik Forums
Testing Framework Forum
1 answer
154 views
Hi. 
I have problem. My test failed in Chrome browser, other browsers work fine.
I launch browser (chrome). Then  I try NavigateTo and test fails.

Manager.LaunchNewBrowser(BrowserType.Chrome);
System.Threading.Thread.Sleep(5000); 
ActiveBrowser.NavigateTo("http://sftfsdev01.tymetrix.com/ReSkin");
            
I tried to set a delay but this didn't help.

Exception text:

ArtOfTest.WebAii.Exceptions.ExecuteCommandException was unhandled by user code
  HResult=-2146233088
  Message=ExecuteCommand failed!
BrowserCommand (Type:'Action',Info:'NotSet',Action:'NavigateTo',Target:'null',Data:'http://sftfsdev01.tymetrix.com/ReSkin',ClientId:'84ea2e5a-0c26-4045-bc93-97431b8d5c8b',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')
InnerException: System.TimeoutException: Timed out waiting for command to be handled
   at ArtOfTest.WebAii.Messaging.Process.BrowserHttpRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId, Int32 timeout)
   at ArtOfTest.WebAii.Messaging.Process.BrowserHttpRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)

Could you help me, please.
Plamen
Telerik team
 answered on 13 Jul 2012
1 answer
128 views
Hi i need get Drag Start event. 

I doing it 

            HtmlTextArea TextAreaText = Pages.XXCrossBrowserTest.EtTextAreaTextArea;
            TextAreaText.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
            MouseEvent mouseover = new MouseEvent();
            mouseover. Type = "dragstart";
            TextAreaText.InvokeEvent(mouseover);

It work IE and FF, but not work in Chrome and Safari.

How I can get DragStart event for Chrome browser?
Cody
Telerik team
 answered on 12 Jul 2012
6 answers
280 views
Hi everyone,

Just to report you that most of the time that we run a test, the first time we are getting a timeout error when the test is trying to connect with the browser (IE8, IE9, Chrome, Safari or Firefox). We need to cancel the test and run it again, and in the this second time the test runs correctly without timeout errors. 

We are using VS and the Browsers extension are installed and enabled.
Does anyone know what is happening this?

Thanks in advance,
Juan
Juan
Top achievements
Rank 1
 answered on 12 Jul 2012
5 answers
383 views
Hi,

I have been getting the exception below in what appears to be on a random fashion. We use the free Telerik Testing Framework 2011.1 and ArtOfTest.WebAii.dll version 2011.1.502.0. I've done what is listed here: http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/troubleshooting_guide/recording-problems/unable-to-launch-recorder.aspx 
-It rarely happens on our local machines running WIndows XP SP3
-It happens a lot on our VMs running Windows XP SP3

I've looked at other threads with similar errors, but I haven't been able to resolve it.
Can you please help? Error below and files attached.

Exception thrown attempting to launch Internet Explorer. Please make sure Internet Explorer is properly installed and you are able to launch it.
System.TimeoutException: Wait for condition has timed out
at ArtOfTest.Common.WaitSync.CheckResult(WaitSync waitString extraExceptionInfo)
at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait)
at ArtOfTest.Common.WaitSync.For(Predicate`1 predicateT targetBoolean invertConditionInt32 timeout)
at ArtOfTest.Common.WaitSync.For(Predicate`1 predicateT targetInt32 timeout)
at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.GetIEFrameFromProcess(Process process)
at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeoutProcessWindowStyle windowStyleString pipename)
System.ApplicationException: Exception thrown attempting to launch Internet Explorer. Please make sure Internet Explorer is properly installed and you are able to launch it.
at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeoutProcessWindowStyle windowStyleString pipename)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunchBoolean waitForBrowserToConnectProcessWindowStyle windowStyleString arguments)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunchBoolean waitForBrowserToConnectProcessWindowStyle windowStyle)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunchBoolean waitForBrowserToConnect)
at WebAii.Framework.Context.WebTest.get_ActiveBrowser() in WebTest.cs: line 88
at WebAii.Framework.Context.WebTest.get_Find() in WebTest.cs: line 95
at IFS.AF.BaseContext.AfWebTest.<.ctor>b__0() in AfWebTest.cs: line 89
Paola
Top achievements
Rank 1
 answered on 11 Jul 2012
4 answers
114 views
I have created a wpf test application with RadColorPicker control in it. I want to chose some colour. I use the following code:
var radColorPicker = app.MainWindow.Find.AllByType<RadColorPicker>();
radColorPicker[0].SelectItem(0, 1);

The following exception is raised:
Element Not found!
FindExpression used: 
[name 'Exact' ToggleButtonElement]


What am I doing wrong? Element is highlighted and identified right.
Plamen
Telerik team
 answered on 11 Jul 2012
4 answers
496 views
Hi,

Is there any possibility to attach to just opened new WPF window in the main WPF application?

Manager manager = new Manager(false);
 
manager.Start();
             
WpfApplication wpfApplication = manager.LaunchNewApplication(@"Wpf.Application1.exe");
WpfWindow wpfWindow = wpfApplication.GetWindow("MainWindow");
 
wpfWindow.Find.ByName<Button>("button2").User.Click(); //The new WPF window is shown, how can I attach to it?

I would be really grateful if you could provide me with some C# examples.

Thank you in advance.

Stas.
Anthony
Telerik team
 answered on 09 Jul 2012
1 answer
111 views
Hello All having issues with the HTMLControl.Refresh()

In the below code, I am creating a new thread to monitor a specific Object for changes.  The code "freezes" at the HTMLControl.Refresh() part.  No error are generated, it just get stuck and cant get pass that call.  Any ideas?

//Service that actively monitors a spesific HTML DOM Object for changes
//IF the HTMLControl is found the object monitored, a true is set
namespace Newton2_Automation.SharedFunctionLib
{
    public class MonitorHtmlObject
    {
 
        public MonitorHtmlObject(HtmlControl monitorControl, string htmlId = null, string htmlClass = null)
        {
            _monitorControl = monitorControl;
            _htmlId = htmlId;
            _htmlClass = htmlClass;
        }      
         
        public void Start()
        {
            oThread = new Thread(new ThreadStart(HTMLRunner));
            oThread.Start();
            while (!oThread.IsAlive) ;
        }
     
        public bool Output;
 
        public void Stop()
        {
            oThread.Abort();
        }      
        private void HTMLRunner()
        {
            Output = false;
            while (true)
            {
                try
                {
                    if ((monitorControl.Find.ByAttributes(_htmlId)) != null)
                    {
                        Output = true;
                    }                   
                }
                catch
                {
                    continue;
                }
                _monitorControl.Refresh();
            }
 
        }
        private Thread oThread;
 
        private HtmlControl _monitorControl;
        private HtmlControl monitorControl
        {
            get
            {
                while (_monitorControl.IsRefresh == true)
                {
                    Thread.Sleep(100);
                     
                }
                return _monitorControl;
            }
 
        }
 
        private string _htmlId;
 
        private string _htmlClass;
 
    }
}

This how its being called:
foreach (HtmlDiv col in getPlaceHolders)
            {
                int ColCounbt = new int();
                try
                {
                    ColCounbt = col.Find.ByTagIndex("ul", 0).ChildNodes.Count;
                }
                catch
                {
                    ColCounbt = 0;
                    continue;
                }
                if (ColCounbt > 0)
                {
                    HtmlListItem[] GagetColection = new HtmlListItem[col.Find.ByTagIndex("ul", 0).ChildNodes.Count];
                    for (int i = 0; i < GagetColection.Count(); i++)
                    {
                        GagetColection[i] = ((HtmlUnorderedList)(col.Find.ByTagIndex<HtmlUnorderedList>("ul", 0))).ChildNodes[i].As<HtmlListItem>();
                    }
 
                    foreach (HtmlListItem item in GagetColection)
                    {
                        HtmlUnorderedList toCol = getPlaceHolders[sf.GenRandomNum(0, getPlaceHolders.Count())].Find.ById<HtmlUnorderedList>("undefinedGadgetHolder");
                        item.Refresh();
                        HtmlDiv GadgetHeader = item.Find.ByAttributes<HtmlDiv>("class=~gadget-head");
                        MonitorHtmlObject monitor = new MonitorHtmlObject(toCol, "class=gadget-placeholder");
                        monitor.Start();
                        GadgetHeader.DragTo(toCol, OffsetReference.AbsoluteCenter, Point.Empty);
                            Log.WriteLine(monitor.Output.ToString());
                        monitor.Stop();
                        ActiveBrowser.WaitForAjax(10000);
                        System.Threading.Thread.Sleep(5000);
                    }
                     
                }          
            }



Cody
Telerik team
 answered on 06 Jul 2012
2 answers
151 views
Hello again,

I'm working with RadGridViews this time and I'm having trouble searching/iterating through them.
What I want to do is to find a row in the grid where a specific field's text matches a specific string, and right clicks to open a menu.
Here's the xaml for reference.  Attached is a picture of me right-clicking on a row where meter name = "freepadthai"
<telerik:RadGridView Grid.Row="3" Margin="15,15,15,0" Name="meterGrid" VerticalAlignment="Top" HorizontalAlignment="Left" IsReadOnly="True" Opacity="100" RowIndicatorVisibility="Collapsed" Grid.Column="0" Grid.ColumnSpan="3"
    AutoGenerateColumns="False" SelectionMode="Single" telerik:StyleManager.Theme="Office_Blue" Height="250" RowActivated="meterGrid_RowActivated" >
 
    <!--Fade In Animaiton-->
<!--<telerik:RadGridView.Resources>
<Storyboard x:Name="_animationGridLoad">
<DoubleAnimation Storyboard.TargetName="meterGrid" Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:2" AutoReverse="false" />
</Storyboard>
</telerik:RadGridView.Resources>-->
 
<!--Right Click Context Menu-->
<telerik:RadContextMenu.ContextMenu>
    <telerik:RadContextMenu ItemClick="RadContextMenu_ItemClick">                
        <telerik:RadContextMenu.Items>
            <telerik:RadMenuItem Header="Create New Meter" CommandParameter="Create" />
            <telerik:RadMenuItem Header="Edit Meter Details" CommandParameter="Edit" />
            <telerik:RadMenuItem Header="Delete Meter" CommandParameter="Delete" />
            <telerik:RadMenuItem Header="View on Map" CommandParameter="View" />
            <telerik:RadMenuItem Header="View Meter History" CommandParameter="History" />
            <telerik:RadMenuItem Header="View Documents" CommandParameter="DocLibrary" />
        </telerik:RadContextMenu.Items>
    </telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
 
<!--Display Columns-->
<telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn Width="*" Header="Meter Name" DataMemberBinding="{Binding MeterName}"  />
    <telerik:GridViewDataColumn Width="*" Header="Manufacturer" DataMemberBinding="{Binding MainManufacturer}"  />
    <telerik:GridViewDataColumn Width="*" Header="M.C. Approval" DataMemberBinding="{Binding MainMCApprovalNum}" />
    <telerik:GridViewDataColumn Width="*" Header="CT Ratio" DataMemberBinding="{Binding CTRatio}" />
    <telerik:GridViewDataColumn Width="*" Header="Meter ID" DataMemberBinding="{Binding MeterID}" />
</telerik:RadGridView.Columns>
 
</telerik:RadGridView>
Joe
Top achievements
Rank 1
 answered on 04 Jul 2012
1 answer
124 views
Hi.
I have problem. I designed test and I need emulation mouse work (DoubleClick and mouse wheel).

For DoubleClick I write 
Pages.T360CrossBrowserTest.EtTextAreaTextArea.MouseClick(MouseClickType.LeftDoubleClick);
and it is fine work.

But when I write 
Pages.T360CrossBrowserTest.EtTextAreaTextArea.MouseClick(MouseClickType.Wheel);
it is don't work.
Anthony
Telerik team
 answered on 03 Jul 2012
2 answers
140 views
Hello,

Working on the UI Testing, I'm wondering how would I get text/value from a already selected RadComboBox.
Thanks for reading - Joe

[TestMethod]
public void SampleWebAiiTest()
{
    Settings.Current.Web.EnableSilverlight = true;
    Manager.LaunchNewBrowser();
    ActiveBrowser.NavigateTo("http://demos.telerik.com/silverlight/#ComboBox/FirstLook");
    SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
 
    Telerik.WebAii.Controls.Xaml.RadComboBox cb = app.Find.ByAutomationId<Telerik.WebAii.Controls.Xaml.RadComboBox>("TechnologySelection");
    Assert.IsNotNull(cb);
    cb.SelectItem("Silverlight", true);
    Assert.AreEqual("Silverlight", cb.Text); // Not working, Expected <Silverlight>, Actual <>
 
    System.Threading.Thread.Sleep(1000);
}
Joe
Top achievements
Rank 1
 answered on 03 Jul 2012
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?