Hi,I am using Ranorex Studio for UI automation testing. I was able to identify controls on the login screen and populate them with data and then click login button. After the login goes successful i have some prism modules being loaded and then a screen which has XamDataGrid on it . FieldLayout in the Xamdatagrid are initialized dynamically . The problem is when i ran the application directly from Visual studio or from installed Executable, It loads the Xamdatagrid fine but when i load the same Executable via Ranorex studio it crashes on FieldLayout Initializing event. Screenshot of the exception is also attached. I am using Ranorex Studio(V 7.0.0)
Excetopn Stack trace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at Infragistics.Windows.DataPresenter.Internal.TemplateDataRecordCache.GetPlaceHolder(FieldItem f, Boolean label, Boolean requireMatchingField) at Infragistics.Windows.DataPresenter.AutoSizeFieldHelper.GetTemplateElement(FieldItem f, TemplateDataRecordCache cache, Boolean isLabel) at Infragistics.Windows.DataPresenter.AutoSizeFieldHelper.GetLabelPresenter(FieldItem f, TemplateDataRecordCache cache) at Infragistics.Windows.DataPresenter.AutoSizeFieldHelper.Calculate(RecordEnumeratorBase outOfViewRecords, AutoSizeCalculationFlags flags, RecordFieldList& recordFieldList, Boolean trackRecords, RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.AutoSizeFieldLayoutInfo.PerformAutoSize(Boolean isHorz, IEnumerable`1 autoFields, RecordCollectionBase records, Int32 recordManagerDepth, HashSet recordsSubset, Boolean increaseOnly, OperationType operationType, FieldAutoSizeOptions allowedOptions, RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.AutoSizeFieldLayoutInfo.ProcessPendingOperationsImpl(RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.AutoSizeFieldLayoutInfo.ProcessPendingOperations(List`1 pendingAutoSize, RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.DataPresenterBase.ProcessPendingAutoSizeOperations() at Infragistics.Windows.DataPresenter.DataPresenterBase.OnLayoutUpdated()
Hello Shahab,
I have reviewed your scenario and the best way for us to assist you is if you provide a small isolated sample that we can run and use for debugging locally. If you are unable to provide an isolated sample I may be able to give suggestions if you provide the code for XamDataGrid, it's FieldLayout and the settings that you are using.
We are providing a product that is designed for creating automation test especially for our controls. Here is a link from our web site, where you can find more information about the our Test Automation:
https://www.infragistics.com/products/test-automation-hp-uft
Let me know if you have any question.
Sincerely,ZhivkoAssociate Software Developer
Hi Zhivko,
Thanks for the reply, For the first step let me share with you the code for fieldLayout Initialization Event handler because making a sample project where i can produce this scenerio would be quite a lot of effort. We have a list of data where properties(columns) could be dynamically changed, So we are binding them as dictionary objects . We are generating FieldLayout at run-time.
The mostconfusing things is when i run application directly it works just fine but when i run it with Ranorex it crash though Ranorex isn't changing anything in application runtime enviornment. One thing to mention here is FieldLayout initialize event handler is called successfully and exception is generated afterwards but if i comment out the code to initialize fieldlayout, application runs just fine. I have attached the code for event handler if it can help you better understand the scenario.
Thanks for suggesting the Infragistics Automation Tools but we can't use them right now because we have already made custom solutions based on Ranorex.
Regards//
Shahab
Hello Shabab,
Thank you for the provided code snippet.
I have reviewed the file you have attached and I have created a simple sample application based on your scenario. I have tested this project with Visual Studio and Ranorex Studio and I was unable to reproduce the exception that you are having.
I have attached the sample project I used to test this. Please test this project on your PC, whether or not it works correctly may help indicate the nature of this problem. If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version 16.2.20162.1006 and 16.2.20162.2109 in WPF product.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. If this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back to me.
Please let me know if I can provide any further assistance.
We have removed unnecessary files from the solution and uploaded the sample which crashes the application in most cases. When you run the UI project, it will ask for Username password, just enter anything and press login. We have just added about 8 seconds delay in an async function where it crashes.
Please find the solution from here
https://www.dropbox.com/s/8em9harf0hargrd/SampleOfCrash.zip?dl=0