I received the latest blog from Brian Harry, a MSDN blogger. He wrote a post about coded UI tests and 3rd party .NET controls. He summarizes the feature of a 3rd party control provider (I won't say who).
One can start recording actions on a _____ control using Coded UI Test Builder and play them back using Coded UI Test. These controls also expose meaningful rich properties that could be used for functional validation during automation test, for example, validate the control specific property RowIndex on a ______ control. ______ has also added rich APIs to ease authoring of Coded UI Tests on custom controls. Last but not the least, conversion of sequence of actions into meaningful intent has been made possible through the aggregation filters, for example, navigation through filter tree to set filter condition on a grid is now converted to one composite action which sets the filter value.
My team has to look into the possibility of building Coded UI tests this summer with infragistics. I'd like to find out more about how difficult this task will be with Infragistics, and how deep on can drill into tests with infragistics controls. THere are many, many posts about coded ui tests on this forum. Do you have a specific guide or FAQ related specifically to Infragistics and coded UI tests to help with the issue? I am worried we will hit obstacles one at a time, having to read through the many, many posts on these forums on coded UI.
Any help for getting started in the right direction would be helpful,
Thanks all!
Hello,
What platform are you looking to use Coded UI Test with?
WPF / Visual Studio C#.NET / Windows Vista
We are hoping to build the usual coded UI tests offered in visual studio
Hi,
I have registered to find an answer to my question with which i am struggling for past 2 weeks .
Our application is built using IGGrid Infragistic controls to display the data.
I written coded-UI automation test in Visual studio 2013 against a very simple scenario.
It launches IE browser and maximizes it. and then it needs to click on a search hyperlink (simple HTML control), it clicks ( I can see focus and button is being pressed) but page keeps on loading i.e. there is a progress-spin icon which keep spinning indefinitely and subsequent page doesn't load at all.
Along with this issue i face one more issue by default when we login to the application one table with data is displaying and first row value is displaying in right result pane by default, but when my script says click on other tab table is displaying but the values are not rendering in the result pane.
My test method is not stopping or failing to click on search link, it is identifying the search link and clicking on it.
It's clicking the row-column values but it's not refreshing the data displayed when i tried to sort columns, which it is supposed to do.
The page is not getting refreshed and the data is not getting loaded.
I have simulated this scenario manually it's working fine.
I am using VS2013 Ultimate and IE10.
Need immediate help.
Thanks
I believe we need more details about the issues that you see and possibly a sample that reproduces them. For the first issue where you get the progress-spin icon, typically this is shown by controls when doing an AJAX call to the server, do you know what specifically is providing this progress indicator?
What controls are involved when you are making a selection in a table and displaying results in another? What events are you using to provide this functionality?
Please provide more details about the controls involved in the test and what events you are using to provide the functionality of your application so that we may set up a test.
Let me know if you have any questions with this matter.
Hi Alan,
Thank you for the reply.
About your first question i'll try to check with the developers and get back to you.
The controls involved while making selection are 1 table and one label in which if we select any row of the table those values from the selected row should get displayed on the result label and click event is used for this functionality. Similarly, there one text box to enter the search criteria and on click of search hyperlink it is supposed to display the filtered matching results but it's not doing as expected.
Please find the details below:
1. Steps to Reproduce
Manually it's working as expected but with the automation script it's not.
Write a coded UI test script to perform following. actions to simulate the issue scenario.
1. Enter the url of application.
2. By default one Grid(Infragistic) will load some data on login to the application,
click on any column to sort that column data.
The click action will happen but the data will not get sorted and refreshed. // Issue 1
Please try to simulate this with the coded ui test script for the reference, I am pasting the block of code it's not recorded, it's hand coded.
BrowserWindow browser = new BrowserWindow();
HtmlEdit usrname= new HtmlEdit(browser);
HtmlEdit password= new HtmlEdit(browser);
HtmlButton loginBtn = new HtmlButton(browser);
browser.searchProperties.Add(BrowserWindow.PropertyNames.FriendlyName,"abcd");
Process.Start"IE","http\\pageURL");
browserWin.Maximized = true;
usrname.SearchProperties.Add(txtbxProp, txtbxpropValue);
password.SearchProperties.Add(txtbxProp, txtbxpropValue);
loginBtn.SearchProperties.Add(HtmlButton.propertyNames.FriendlyName","Login");
username.text ="abcd";
password.text="";
Mouse.click(loginBtn);
//Till here all works well
HtmlTable listTable = new HtmlTable(browser);
HtmlCell clkCell = new HtmlCell(listTable);
HtmlLabel testReLabel = new HtmlLabel(browser);
listTable.SearchProperties.Add(HtmlTable.PropertyNames.Id, "GridId");
clkCell.SearchProperties.Add(HtmlCell.PropertyNames.RowIndex, "1");
clkCell.SearchProperties.Add(HtmlCell.PropertyNames.ColumnIndex, "3");
string chkVal = clkCell.InnerText; Console.WriteLine(chkVal);
Mouse.Click(clkCell);
testReLabel.SearchProperties.Add(HtmlLabel.PropertyNames.Id, "selectedDetail");
Assert.AreEqual(chkVal, testReLabel.InnerText);
-------------- Issues Faced-------
This fails because on click of clkCell the testReLabel is not getting refreshed with the values of selected Cell.There's one search field criteria based on the given criteria it should display those values only in the grid but it's not doing so.
On clk of cell header it should display that column in either ascending or descending order in the gris but it's not doing so.
This issue my script is facing across the application and the developer has used IgGrid for this.
Hope, now the issue is somewhat clear.
Looking forward to the reply.
Do we have any workaround for this issue.
I am in real need to know whether we can continue Automation with these infragistic controls using Coded UI tests or not?
Thanks!
Hi there,
I can share some of the experience we've had with Coded UI. When Ignite UI was started at Infragistics we wanted to create our UI tests using Coded UI. We started and wrote a good number of tests, so this answers the question of whether you can test Ignite UI using Coded UI: yes you can. We determined that this is not the right test framework for us though. This is due to several reasons:
1. CodedUI does not provide with a deterministic wait for UI refresh which is the issue you're facing. I assume that the correct element is retrieved by the code example you've posted, so add a Thread.Sleep() after performing the click and check whether your tests would perform the interaction that you intended. If it does succeed keep in mind that we've determined that the framework is somewhat inconsistent and the time span for the sleep should be increased if your tests are running on a slower machine.
2. CodedUI provides you with automation only for Internet Explorer.
3. CodedUI proved rather inconsistent for us when a large batch of tests needs to be executed. We were getting random framework failures after the 50th or so test.
Don't get it wrong, I am not trying to badmouth CodedUI. I am sure this framework is really good for UI tests on desktop platform, but our experience with it for browser tests has not been good.
Thank you for using the Infragistics forums!
Thank you for sharing the solution that you found.
Hi Everyone,
I would like to post the workaround solution for the problem i was facing .
The actual issue was, that J Query Ajax Success was not getting triggered by Coded U I.
This issue is visible in J Query 2.0 and 2.0+ versions.
I found this post
http://stackoverflow.com/questions/17849074/jquery-ajax-success-not-getting-triggered-with-coded-ui-test-project/21381319
The solution they have suggested is working
Microsoft's Coded UI browser injects javascript to shim the XMLHttpRequest object for tracking. Any ajax calls in the page will use this shim instead of the real XMLHttpRequest. The shim assumes that your completion callback is attached to the XMLHttpRequest's onreadystatechange property, but jQuery 2.0 and + uses the new onload and onerror events, so the callback is never called by the shim.
Workaround
The work-around is to add the following to the App.config file for your test project:<?xml version="1.0" encoding="utf-8" ?><configuration> <appSettings> <add key="WebWaitForReadyLevel" value="3"/> </appSettings></configuration>Setting WebWaitForReadyLevel to 3 stops the Coded UI WebBrowser from injecting the javascript to track ajax calls and timers. jQuery will get a real XMLHttpRequest, and your ajax callbacks will work again.
Hope this will help others too.
Thanks,
Hi Konstantin,
Thank you for your suggestions.
I'll try with thread.sleep.
I'll post it here if it works.
Best Regards,
Hi Alexander,
Thank you for the reply. really appreciate.
The sample application what you have given is working fine, and the thing is that using Selenium web driver also this is working.
Then the problem must lies in between my application and VS i guess.
The application is a bit slow.
I'll try to make it work, if it works i'll post here.
Hi ADRUSTA, I am attaching a simple Coded UI test that is opening the igGrid "Sorting (Remote)" sample, sorting the "Product Name" column and verifying the column is sorted. The test is passing and I can`t see any issues.
Thank you for using Ignite UI!Regards, Alexander Marinov