Telerik Forums
Testing Framework Forum
9 answers
209 views
I am using the 2010.1.713.0 WebAii code with its Telerik.WebAii.Controls.Html.dll Translator for ASP.NET AJAX RAD Controls. I am using the latest controls dll 2010.2.713.35.

var ed2 = Find.ByCustom<Telerik.WebAii.Controls.Html.RadEditor>(a => a.ID.EndsWith("MqTelerikEditor"));

Assert.IsNotNull(ed2, "Did not find the editor");

const string html = "Test Code";

 

ed2.Html = html;

This test fails on the last line with this exception and stack dump.

ArtOfTest.WebAii.Exceptions.ExecuteCommandException : ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'Test Code\')] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: [object Error] 
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'Test Code\')',ClientId:'Client_0f07abc3-99d2-47b2-aa1e-aa5d60203816',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.InvalidOperationException: Javascript call [$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'Test Code\')] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: [object Error] 
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.


I am guessing there is a miss match with the Translator and that I need a 2010.2 version. Is this due?

When I watch the test run I see the content of the Editor does take the new content just before it crashes out.

John.

Petia
Telerik team
 answered on 02 Aug 2010
4 answers
155 views
Hi Guys, 

Using Nunit, FF (3.0.19), VSE 08. 

I'm using the following code to click a button (AJAX buttons are handled  in a slightly different way..):
public void ClickButtonByGUICaption(String buttonGUIName)
   {
       StringBuilder buffer = new StringBuilder();
       buffer.Append("//input[@value=\"")
             .Append(buttonGUIName)
             .Append("\"]");

       Manager.ActiveBrowser.Find.ByXPath<HtmlInputSubmit>(buffer.ToString()).Click();
       Manager.ActiveBrowser.WaitUntilReady();
   }
The above works well at most scenarios except a few in which the above is followed by an assertation  of some kind as 
check if txt exists ext. 
The test passes however when 'executionDelay'  value is increased from 100-150 to 800 or more, indicating the issue is not the code (In a sense that I'm not looking for the wrong element etc). 

Am I using/understanding WaitUntilReady method wrongly ? My assumption is that if WaitUntilReady
is the last action the ClickButtonByGUICaption ()initiates, there should be no issues initiating any kind of verification/action past that point on the page that loads as the page is supposed to be ready. Does ready = fully loaded ?

Pls note that using WaitForElement/Frame maybe quite tedious in my case as I have a large number of situations so I need to use a more generic solution as the above. 

Ta, 
SD. 
 














SD
Top achievements
Rank 1
 answered on 30 Jul 2010
8 answers
114 views
I prefer to study WebAii with snippets and examples ( documentation is really far from comprehensive, but framework is great btw)
Today I found some strange behaviour - I serialized FindParam to file, cause i cant figure what exactly i should write in my Find filters in one special case. I used this code to do serialization
private void filtersSerialization()
{
    var param = new FindParam(FindType.Content, "p:My Solutions Ltd",
    new[] { "onclick=~document.getElementById('cancel_return').value = '1';"});
 
    var paramCol = new FindParamCollection
    {
    { "Sample", param }
    };
 
    paramCol.Save(@"d:\AppParams.xml");
}

And this code created following text
<FindParamItem key="Sample" >
<FindParam TagName="a" XPath="" NodeIndexPath="" Type="Content" ContentType="TextContent"
ContentValue="p:My Solutions Ltd" TagOccurrenceIndex="-1" >
<Attributes />
<PartialAttributes>
<iAttribute Name="onclick" Value="document.getElementById('cancel_return').value = '1';" />
</PartialAttributes>
</FindParam>
</FindParamItem>

But this isnt exactly correct 
onclick should be with screened \'
<iAttribute Name="onclick" Value="document.getElementById(\'cancel_return\').value = \'1\';" />

Otherwise Find.ByParam wont find any element with this filter loaded from file.

I dont sure where exactly this bug belongs to - serialization or regex attribute matching, but this is a wrong behaviour. Save and Load should behave consistently.

UPDATE:
I found exact difference between in-memory creation of FindParam and deserialized from file:

In-memory FindParam have type of partial iAttribute.AttributeType = Event,
and deserialized one have iAttribute.AttributeType = Other.

And BeginQuote\EndQuote different either (None and DoubleQuote).


Any tips how to deserialize param with AttributeType = Event, and quotes set to None?
Direct xml didn't work =(


Missing User
 answered on 29 Jul 2010
5 answers
126 views
Hi,

I am automating silverlight 3 application using webAii 2.0.
I am having a strange issue

when i use the below code in Dev source code of my application its getting timeout. But the QA version of the same works fine.

ActiveBwoser.SilverlightApplications()[0];

Anyone has any info on this.
I developed simple silverlight application and locally tested thats is working fine. But my real project is not.

Thanks
Kiran
Missing User
 answered on 29 Jul 2010
2 answers
122 views
Hi,

I am using WebAii 2010.1 for automating silverlight 3 application.
In my application i am having childwindow in which i am loading a wizard like control.
In that wizard controls are created dynamically.

But i am not able to get those dynamically created controls.
I tried refreshing the visual tree like below but not working.

app.RefreshVisualTrees();

app.VisualTree.Refresh();

app.Popups[0].VisualTree.Refresh();


Please help me its urgent.....
Thanks in advance

Kiran
Top achievements
Rank 2
 answered on 28 Jul 2010
5 answers
181 views
Hey all,

After much wrestling, we're making good headway in making WebAii work for us, and not the other way 'round.  :-)  (We're trying to abstract away WebAii for various long term maintainability reasons, so this obviously presents itself as fighting the original design and intent of WebAii, causing a lot of initial frustration, and rightly so).

We're noticing that when the framework is installed in the typical fashion, when adding a reference to the assembly from a different folder to the solution, the reference is redirected to the install base.

Is there a way to circumvent this besides uninstalling the framework after grabbing the necessary binaries?  What controls this behavior?  Since we're basing our solution on a very specific version for consistency reasons, we really only want to reference the tools from our source controlled location.  However, referencing the copied assemblies from any other folder still causes it to point to the /Program Files/ location.

Thoughts?

Thanks in advance and thanks for all the help and patience provided so far.
Steven Raybell
Top achievements
Rank 1
 answered on 28 Jul 2010
3 answers
165 views
Hi,

I am using WebAii. 2010.1 version for silverlight 3 automation.

I have to get all the ComboBoxItmes from a combobox. But i am getting empty list.

 

 

 

ComboBox cmbBox = app.Find.ByType<ComboBox>();

 

 

IList<TextBlock> blocks = cmbBox.Find.AllByType<TextBlock>();

 

 

IList<ComboBoxItem> items= cmbBox.Items;

 

 

IList<ComboBoxItem> cmbItems = cmbBox.Find.AllByType<ComboBoxItem>();

 

 

IList<FrameworkElement> cmbFrameworkItems = cmbBox.Find.AllByType("ComboBoxItem");

 

 


Thanks
Kiran

Konstantin Petkov
Telerik team
 answered on 28 Jul 2010
4 answers
134 views
Hi,

I am using WebAii 2.0 for silverlight 3 automation.

I need to click the Plus(+) sign in the RadGridView. Please see the attached image for reference.
Actually what is that Plus(+) sign control. Is it an image or anything else?

Is it possible through Translator? Any way i want the other way.

Thanks
Kiran
Kiran
Top achievements
Rank 2
 answered on 27 Jul 2010
6 answers
157 views
Hey all,

I'm currently experiencing an issue where when attempting to get the SilverlightApp, the automation experiences a Timeout.  I've tried changing security settings as per instructions for setting up for WebAii, I've tried running as admin, impersonation, the works.

I can access HTML elements without issue, however, when attempting to get the app, it finds the element (as reflected by debugging) for the Silverlight object, but the app reference fails return.  Increasing the timeout only results in the exception coming later and does not improve the situation.

The code here:

            this.Manager.LaunchNewBrowser(BrowserType.InternetExplorer, true, System.Diagnostics.ProcessWindowStyle.Maximized);
            this.ActiveBrowser.NavigateTo("https://ourwebsite/OurAppLocation/");

            SilverlightAppsList appsList = this.ActiveBrowser.SilverlightApps();
            SilverlightApp app = appsList[0];

results in the exception on the last line.

I've tried other .NavigateTo()+ overloads as well, without success.  Interestingly, this happens on my machine, by not my coworkers'.  Another coworker is continually having issues getting an initial action from the navigation process to work, even after modifying the security settings for IE.  We have yet to find a common problem here, other than WebAii is having a very difficult time getting the application handles, be it browser, or the SilverlightApp.

Perhaps we're missing something vital?

My machine configuration:

- Visual Studio 2010 Ultimate
- Server 2003
- IE 7
- Default Template (VSUnit)

At this rate, we've invested so much time, with little yield, we're becoming somewhat disenchanted.  Any help to get us on track ASAP would be most beneficial.  I'm trying this on another machine and will report back if the same results are observed there.
Steven Raybell
Top achievements
Rank 1
 answered on 27 Jul 2010
3 answers
183 views
I have a test that worked with an older version of WebAii (Beta). I just downloaded the latest version and the tests that run with IE all fail but work with Firefox.

The test fails when I call LaunchNewBrowser(). IE starts up and goes to "about:blank" and is functional (I can use it directly) but the method fails with exception

System.TimeoutException : Wait for condition has timed out

at ArtOfTest.Common.WaitSync.CheckResult(WaitSync waitString extraExceptionInfo)
at ArtOfTest.Common.WaitSync.For(Predicate`1 predicateT targetBoolean invertConditionInt32 timeout)
at ArtOfTest.WebAii.Core.Manager.WaitForBrowserToConnect(Int32 browserIndexToWaitFor)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunchBoolean waitForBrowserToConnectProcessWindowStyle windowStyleString arguments)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunchBoolean waitForBrowserToConnect)
at Marqui.Tests.wxWeb.ArtOfTest.TestArtOfTest.InitializeInstance() in TestArtOfTest.cs: line 36


My test looks like this:

      SetTestMethod(this, "InitializeInstance");

      Manager.LaunchNewBrowser(BrowserType.InternetExplorer, true);

      ActiveBrowser.NavigateTo("http://www.google.ca");

and I have a SetUp method that looks like this

    [SetUp]
    public void InitializeEachTest()
    {
      var settings = new Settings(BrowserType.InternetExplorer, LogLocation)
                       {
                         DefaultBrowser = BrowserType.InternetExplorer,
                         RecycleBrowser = true,
                         BaseUrl = TestSite,
                         ClientReadyTimeout = 60000,
                         ExecuteCommandTimeout = 60000,
                         AnnotateExecution = true,
                         AnnotationMode = AnnotationMode.All
                       };

      // Now call Initialize again with your updated settings object
      Initialize(settings, LogCaller);
    }


 John.
John Woakes
Top achievements
Rank 1
 answered on 26 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?