Hi Team,
Am automating .NET Windows forms using QTP 10.0 and Test advantage 10.3.0.0.
Application uses Net advantage controls and Object identification works fine in the active window(Visible window). However am facing issues in identifying the objects where the objects are not visible in that window. I used the workaround like scroll down to make object visible .
I need to know is that the correct way or is there any settings or any othere way of identifying the object without scrolling the window.Usally its seen that QTP identifies the object in the page irrespective of scroll down.
Thanks in Advance
Hi,
Is it not identifying the object when recording them, or is it recording fine, but not identifying the objects during replay? The way you question was phrased it could lean either way, but I am guessing it is more during replay. Typically if an object not visible exception is thrown it leans towards the fact that while the object itself was found but the action requires UI interaction and the object is not on the screen. All of our actions should by the best of their ability try to scroll the control into view. So that leaves two possibilities one, the action, may for some reason be missing the scroll into view call, or something else possibly in the application is keeping it hidden.
Let's start off by testing my hypothesis about the object being found but just not visible. As of 10.3 all of our controls have at least three Get methods, GetNAProperty, GetNAProperties, GetProxySetting, these should not require the object to be visible to run. If any of these pass, then the object is found, the proxy is loaded and working correctly, it is just not visible.
Next let's assume that it maybe in the proxy, if so, what is the swftypename of the control\controls that are having the problem, and what is are the action\actions that are failing?
-Mike
Thanks Mike,
The issue of not identifying the object is during the playback. Let me drill down to the scenario so that i can give you better idea of problem am facing
I have a swfcombobox at the end of the window.To learn the object property or record, i need to scroll down the window and that works fine. During the playback am using scroll down option to make the object visible and then i will perfom the action. If i keep the action limited to just select an item from the list or get itemcount then the script works fine, however if try to validate Items count and retireve items from the comboBox then whats happening is after i read the item count the window automatically moves up making the object not visible then am using "VScroll micScrollEnd ,5scroll" to make the object visible but during retrieval(getItem) the window again moves up automatically.However if i manually scroll down the window again then it retrieves a item and immediatly window moves up again,also if i have swfbutton(submit button) to click then able to achieve using fireevent and not by regular click method.
The conclusion is that without manual intervention am not able to complete the actions for the objects needed scroll down.
swifttypename : Infragistics.Win.UltraWinEditors.UltraComboEditor
swifttypmename : Infragistics.Win.Misc.UltraButton
Hope am able give sufficient information regarding my issue.Thanks for your time and patience Mike
-Nooruddin
Hi Nooruddin,
To be honest I am at a loss for why this issue is happening. My first thought is that there is something about the container control (SRDashSolution.PhoneManagementModule.OnePageView) or maybe your environment that may be causing this behavior. The container does appear to be a custom container in some manner. As to the environment I have seen other similar odd behaviors when our NetAdvantage WinForm controls are added to an ASP.NET page, I imagine same difference if it was added to a WPF or Silverlight environment. Not sure that is the case, but I would be curious if that is the scenario.
I am curious, did you add the VScroll to the script because it wouldn't scroll into view on it's own? If not have you tried without the VScroll and without turning off the AutoScrollIntoView?
A developer support case has been opened on this matter on your behalf. I would recommend them reviewing this in more detail with you, and if possible if you could provide them a sample of this behavior it would greatly help us in determining the cause of the behavior.
Well even i was surprised when i noticed that objects are not auto scrolling into view and i was forced to use VScroll and then noticed that after every action on the object ,the Window was automatically auto scrolling and then you provided me with the solution of setting AutoScrollIntoView as false which worked.
To be informed, i did try without using vScroll and also without turning off AutoScrollIntoView,but not dint work.
To bring to your notice, am actually thinking that there may be slight issue with coding over identification of .Net advantage control. This is just my observation and only developers can drill down more on this. The observation is that after every action on the object, the system seems AutoScrollIntoView method to be actually scrolling UP rather the doing only when required. Say if you are working with single window application then you may not notice any difference in behaviour afrer the action, However if you got the applications which has multiple Window(pages) where you need to scroll down to get it visible, the problem of AutoScrollIntoView seems to be causing to move the window UP after a action is performed. I may be wrong but this is what i can say from my experience on working with Test advantage Add-in with my application. Also to be informed that if i execute cases in application manually the system doesnt scroll up
I hope the information provided helps and mail me across if any other information is required.
Regards
Nooruddin
HP-IT
At this point I can poke blindly at a few hypothetical solutions, but as mentioned before I believe we will need a sample that reproduces this behavior, to truly understand what's going on and how to resolve it. The only other scenario I can see that would do as you describe is a little far fetched, being that the control's upper left hand corner is being recognized as the point it is scrolling up to, which in that case, there would be no "permanent fix" for that scenario. Turning off the AutoScrollIntoView, and manually scrolling the portion of the control that you need to interact with would be the resolution. Does this happen with every control that needs to be scrolled into view or just this solitary UltraComboEditor?
firstly am not able to add any notes/Comment at the location
http://www.infragistics.com/membership/mysupport.aspx?CaseNumber=CAS-63752-GVG0LN
coming back to the issue, we are facing this issue with all controls which needs to be scrolled into view. Manually scrolling the objects into view is bit tedious and sometime may turn up to be unreliable and thats were we thought of having permanent fix.
In my previous notes/blog i have provided with the sample script to reproduce, however i shall provide you once again the script, but i would like to know what excatly you are looking in the script which will help you reproduce the scenario
SwfWindow("SR-Dash").SwfObject("OnePageView").VScroll micScrollEnd ,5
SwfWindow("SR-Dash").SwfComboBox("List_Severity").SetProxySetting AutoScrollIntoView , FalseSwfWindow("SR-Dash").SwfComboBox("List_Severity").Select "Medium"
SwfWindow("SR-Dash").SwfComboBox("List_Priority").SetProxySetting AutoScrollIntoView , FalseSwfWindow("SR-Dash").SwfComboBox("List_Priority").Select "High"
SwfWindow("SR-Dash").SwfButton("Button_CreateCase").SetProxySetting AutoScrollIntoView , False SwfWindow("SR-Dash").SwfButton("Button_CreateCase").Click
Nooruddin,
I have reached out to you through email to look into the issue with updating case CAS-63752-GVG0LN and will work with you on that through email.
For looking into the issue with scrolling the controls into view, we need a sample application that has the same issue that we can use for debugging. Only having the script isn't enough for us to look into this issue. As such if you are able to, please provide us with a sample application that demonstrates the same issue.
Let me know if you have any questions with this matter.
I face a similar issue with WpfObject inside a WpfWindow. Please help.
WpfWindow("Window Name").WpfObject("ObjectName").GetCellData(RowNum, "columnName") provides the cell value as long as the cell is in the visible screen. I have 300 to 1000 items to be displayed in the cell. There is no item name to provide in the ScrollIntoView method. The object spy shows the cell as WpfObject inside WpfWindow("Window Name").WpfObject("ObjectName").
Thanks in adavance for your help!
Hi Sasha,
I think ScrollIntoView is the method to work with Net advantage controls for .NET windows forms application.
Am not clear with the problem you are facing, however let me guess and provide you the solution that might help.
I would like to know that after each action/operation is that the application window is auto scrolling back to top of the window?
>>> Try using the method VScroll to scroll it down and perform the operation
>>> You can also try the method object.MakeVisible
>>> Trying using the object model to access native methods (WpfWindow("ObjectName").Object.)
Actually i noticed that most of the window's based objects needs to be visible to automate and you can always drill it down and try all the options either to make it visible, not allow to scroll it up or autoscroll and if it is third party controls then you need to check whether you can get add-in or support to automate those controls. Please let me know if it works and alos correct me if my understanding are incorrect
Thanks
Automation - HPIT
There is currently only extremely limited support for our WPF controls at the moment via QTP alone. We are in the process of developing TestAdvantage for WPF to support our NetAdvantage WPF controls version 10.3 and higher, due out by the end of the year, with a by request CTP available via sales@infragistics.com.
Thanks, Nooruddin!
I have a long list of values which is seen only partially on the screen. I need to retrieve the max value of a specific column for which I had to scroll to end since the column was displayed in ascending order. Now that I have got a solution of sorting the column, I can double click on the column header and have the maximum value on top. However, I dont know a method to access the column header of the wpfobject for sorting.
WpfWindow("Window1").WpfObject("Object1").GetCellData(rowNum ,columnNum) gets me the celldata. But I have no means to click or double click on the columnheader. This being the 13th column, I can go uptil WpfWindow("Window1").WpfObject("Object1").GetCellData(0,columnNum) which gives me the first row 13th grid value. ("M" in the following sample)
C1
C2
C3
C4
C5
C6
C7
C8
C9
C10
C11
C12
C13
C14
C15
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
I hope the problem is clear now. Thanks much for your help!
btw, when I was researching on the scroll issue, I found this useful post by Yaara Tobaly http://www.advancedqtp.com/forums/index.php?action=printpage;topic=5151.0
-Sasha
I have gone through the post by Yaara Tobaly and it is very useful one as it deals with the mouse event actions through declaring and using the procedures of external dll's. In most of the cases this would work and in some cases where change in system or resolution may fail or not reliable because it may trigger the mouse scroll and would not notice any change in the application behaviour and script will fail.
Well are you able to resolve the issue using that function?
I would advice you to go ahead and check for the native methods to scroll (Hscroll or Vscroll) to view the objects into view.
Sasha ,If am not wrong then you are working with WpfTable object right? When you try to add the object see the hierarchy and add it as table object and try WpfTable(Object).Makevisible. Also, you can try all other methods available.Please let me know if it works.