Telerik Forums
Testing Framework Forum
1 answer
118 views
Hi,

We are implementing generic functions for click operations on the Silver light objects.
But, we are unable to write the proper code in C#, please refer below code and help.

We have tried below functions without any success.

1. myManager.ActiveBrowser.Find.ByName<HtmlControl>(objID).Click();  -- Not working
    myManager.ActiveBrowser.SilverlightApps()[0].RefreshVisualTrees();

2. myManager.ActiveBrowser.SilverlightApps()[0].Find.ByExpression(@"XamlPath=/grid[name=RootElement]/border[name=ChartBorder]/grid[name=ChartAreaGrid]/grid[name=CenterOuterGrid]/grid[name=CenterGrid]/grid[name=CenterInnerGrid]/grid[name=PlotAreaGrid]/scrollviewer[automationid=PlotAreaScrollViewer]/border[0]/grid[0]/scrollcontentpresenter[name=ScrollContentPresenter]/canvas[name=PlotCanvas]/canvas[name=DrawingCanvas]/canvas[0]/canvas[0]/canvas[0]/canvas[0]/path[12]",true).User.HoverOver();

3.  myManager.ActiveBrowser.SilverlightApps()[0].Find.ByType<ArtOfTest.WebAii.Silverlight.UI.Path>('Uid="66208306"').User.HoverOver();   -- Not Working..

3. This works when we hover manually on the silver light object to fetch the tool tip value.
string myToolTipVal = STEPForTestStudioclass.myManager.ActiveBrowser.SilverlightApps()[0].Find.ByAutomationId<TextBlock>("ToolTipTextBlock").TextContent;  --> Works fine.

But we need some generic function which will click when we pass the object ID/name/Automation ID of the silver light control.

FYI: While recording and play back it works fine, but we don't want to use that descriptive code but would like to create
some generic functions if possible.

Regards
Tapan
Cody
Telerik team
 answered on 25 Aug 2011
3 answers
134 views
Hi,

I'm experiencing quite strange behavior in terms of log creation. I can reproduce it on win 2003 32bit and Win XP 32bit too. It was fine until I migrated to new machines with same OS. I can see in debug mode (Visual Studio 2010), folder path and log file name gets generated and is kept in settings. I just don't see file physically created on disc drive and all writes to log can be seen in Immediate window like e.g.:

Uncategorized: Log.WriteLineInternal() : Starting execution of: TestCase000

,but doesn't brake execution. 

Any ideas please?

Thanks, David.
Plamen
Telerik team
 answered on 22 Aug 2011
6 answers
102 views
Hi,

I have code that successfully locates a RadExpander control on a Silverlight page using the FindName method of SilverlightApp class.  When I try to cast the resulting FrameworkElement to a RadExpander I get the following error:

  • The control type 'ArtOfTest.WebAii.Siliverlight.UI.ToggleButton' does not match the xaml tag 'radtogglebutton'

Here is some code that represents what I'm trying to do:

  • FrameworkElement element = app.FindName(controlName);
  • RadExpander expander = element.As<RadExpander>();

Any clues on why this is happening.  

Thanks.

Joel
Cody
Telerik team
 answered on 19 Aug 2011
7 answers
341 views

Hello Admin,

I am testing  a Silverlight application with .NET 4.0 Framework, We have a functionality like AttachSignature, Which Invokes windows open dialogue to attach the jpeg signature. This testing need to be automated using Telirk webaii Framework, I do not have any methods to test for this test case. Can you please help me with anything ….

Abi
Top achievements
Rank 1
 answered on 17 Aug 2011
2 answers
77 views
Hi,

My problem is that we have aTest.cs and a.cs.
a.cs contents a variable which will be used until the all testmethods under aTest.cs are finish, but after the first test method the variable is set to null so the remaining test methods will become failed.

Thank you.


 
wilfredo
Top achievements
Rank 1
 answered on 17 Aug 2011
11 answers
232 views
I'm running into an issue when trying to run a sample on my Win 7 x64 environment.  I'm attempting to run this sample:

[TestMethod]
[Description("Detect images as they arrive from the web server")]
public void ImageDetection()
{
    Manager.Settings.Web.UseHttpProxy = true;
    Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
 
    ResponseListenerInfo li = new ResponseListenerInfo(CheckTypeForImage);
 
    Manager.Http.AddBeforeResponseListener(li);
    ActiveBrowser.NavigateTo("http://news.google.com/");
    Manager.Http.RemoveBeforeResponseListener(li);
 
    // Check the test results for a log of all responses during the page load
}

when I hit the line Manager.Http.AddBeforeResponseListener(li); I get this exception:

System.IO.IOException was unhandled by user code
  Message=Pipe is broken.
  Source=System.Core
  StackTrace:
       at System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode)
       at System.IO.Pipes.PipeStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
       at System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.WriteCommandToPipe(PipeCommand command, PipeStream pipe, Boolean waitForDrain)
       at ArtOfTest.WebAii.Messaging.Http.HttpProxyManager.AddBeforeResponseListener(ResponseListenerInfo info)
       at QuickStarts_VSTS_CS.WebAii2Samples.ImageDetection() in C:\Program Files (x86)\Telerik\Testing Framework 2011.1\Samples\Testing Framework\QuickStarts_VSTS_CS\Tests\WebAii2Samples.cs:line 169
  InnerException:

If I run this same sample on my Win 7 x86 VM, it works fine.  Any ideas on what I have to do to get it to work in my x64 environment?

I'm running version 2011.1.712.0.

Thanks!
Cody
Telerik team
 answered on 16 Aug 2011
1 answer
98 views
Hi,
  We have a website that I am trying to automate. Basically there is a Html Input File control and its textbox is disabled. I need to click on its 'browse' button, navigate to the right file location and open a file. Once this is done, I need to upload this file.

We have been using WebAii 2010.2 version for our automation. We wont be able to upgrade to the newer version of the webaii suite. I managed to get this automated and everything seems to work fine on IE8 in Windows 7. But When I try to run this on IE9 on Windows 7, the file dialog opens and then right away closes. below is my code snippet

         
      #1      _manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
 
            _manager.DialogMonitor.AddDialog(new FileUploadDialog(_manager.ActiveBrowser, fileNameToUpload, DialogButton.OPEN, "Choose File to Upload"));
            _manager.DialogMonitor.Start();
            _manager.ActiveBrowser.WaitUntilReady();
            HtmlInputFile updlg = _manager.ActiveBrowser.Find.ById<HtmlInputFile>("ctl00_MainContent_FileUpload1");
       #2     updlg.Click();

when I comment line #1, the dialog opens and right away closes. When I leave line #1 uncommented, then the dialog opens, after a couple of secs, it flickers,
then it flickers, then it stays there forever without moving to the next line of code.

for line #2, updlg.MouseClick() doesnt seem to do anything.


But all of this works fine in IE8!!! Can you guys tell me if there is any way this can be made to work in IE9? If that
is not possible, then is there an Add on for newer versions for Firefox?

When I try firefox, I see it open the window, but nothing happens and the address bar has this text: "about:blank?!!AOT2.0!Pipe.ArtOfTest.WebAii.BrowserProvisioner_517858088"



Am i missing some steps in setting up firefox?


Anthony
Telerik team
 answered on 15 Aug 2011
1 answer
94 views
I've recorded my Out-of-Browser Test and when I execute this written Test I get an Exception at the last Step.
I get this Exception on 2 Different Programms and everytime it runs threw all of the Steps clearly but stucks on that last Step.

The Exception is an Unsupported Browser Exception.
But I have selected and executed an Out-of-Browser Test.

What am I doing wrong ?


Have to edit that it is not that last step everytime.
Stoich
Telerik team
 answered on 15 Aug 2011
1 answer
66 views

Hello,

I am trying to get the tool tip value of the a grid cell, but ideally I am not getting the tool tip value, it even becomes very tough when I try to get the tooltip value of a grid when the grid contains calendar control or combobox control in the grid cell, I have written different functions to get the tool tip value when the gridcell contain combobox or calendar. Or simple textbox for that matter. None of them are working …Can you please help me to resolve this Automation…This is very Critical in my Test Case Evaluation…

       //ABI

        public string GetGridCellToolTip(string gridName, int row, int column)

        {

            IGridControl gridControl = controlFinder.FindGridx(gridName);

            return gridControl.GetGridCellToolTipText(row, column);

        }

        //ABI

 

 

 

        //ABI

        /// <summary>

        /// Get the tool tip text in the cell designated by the given row and column.

        /// </summary>

        /// <param name="row">The cell row.</param>

        /// <param name="column">The cell column.</param>

        /// <returns>The tool tip value of the cell.</returns>

        public string GetGridCellToolTipText(int row, int column)

        {

            //radGridView.Wait.For(f => f.As<RadGridView>().Rows.Count > 0);

            return radGridView.Rows[row].Cells[column].ToolTipText;

        }

        //ABI

Stoich
Telerik team
 answered on 15 Aug 2011
4 answers
159 views
Hi there.

I've just downloaded the latest WebAii bits and I'm really liking the functionality. One thing I cannot find out how to configure is the output tracing from WebAii. In my unit test runners, I see a lot of tracing text such as:

[19:46] - Using ArtOfText.....

How can I disable this text from being outputted? I've looked at the documentation for the settings class, but can't seem to find the setting for tracing. Guess I've missed something. Could someone help me out please?

Cheers.
Jas.
Cody
Telerik team
 answered on 12 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?