Infragistics Community Forum / Test Automation For Micro Focus Uft Windows Forms / Objects Not Identified using Untill Scroll down is used – QTP 10.0 and Test Advantage
Objects Not Identified using Untill Scroll down is used – QTP 10.0 and Test Advantage
New DiscussionHi 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
Replies
-
0
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
-
0
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
-
0
Hi Ammar,
I added SwfComboBox().SetFocus and still dosent work. During the action ,QTP is looking for the object(as the Window automatically moves up).I have to scroll it down to get it setfocus.
Is there any way to stop the Window scroll move during playback?
Nooruddin
-
0
Hi Nooruddin,
What is the swftypename for the parent container that you are calling VScroll on? Also do you have the text of the script in question? Primarily I am looking to see what are the pertinent controls, the exact actions being performed and there swftypenames to properly build a sample that reproduces the behavior. Also I am looking to see if there are any actions that may seem innocuous but may actually be causing the unexpected side effect that you are experiencing.
As a side note, along with what Ammar was saying all of our controls, by default, automatically attempt to bring themselves into view during the calling of any of our custom actions. If for some reason because of the environment or other necessity we also offer the ability to turn this off. These are via proxy settings, settable globally on our controls via swfconfig.xml or during replay-time.
There are actually two settings that may cause this effect the first, is CallPrepareForReplay, by default True, you may want to set this to false. What this setting does is turn on or of the calling of the QTP's internal PrepareForReplay method prior to completion the action. PrepareForReplay does several things, among of which are validating the existence of the object, and making it visible.
The second is AutoScrollIntoView, by default True, you may want to set this to false. What this does is go up the parent tree of container controls that are scrollable, and in turn scroll each control in the link between the parent form and SourceControl into view.
Neither of which should cause issues but as Scrolling seems to be the root of your problem, it may be worth testing the settings of each. You can view the current setting via :
SwfObject("SomeNAControl").GetProxySetting(sSettingName)or set them via :
SwfObject("SomeNAControl").SetProxySetting sSettingName, oNewValue
eg. SwfObject("comboEditor1").SetProxySetting "CallPrepareForReplay", True
Again I don't think either of these settings are the cause, but it may be something to try in addition to supplying the information I requested earlier in this message.
-
0
Thanks a lot Mike,
From the Solutions you provided i tried the below code and it worked fine.
SwfWindow("–").Activate
SwfWindow("–").SwfObject("–").VScroll micScrollEnd ,5
SwfWindow("–").SwfComboBox("–").SetProxySetting AutoScrollIntoView , False
Below is the sample code which i was trying earlier''&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
SwfWindow("–").SwfObject("–").VScroll micScrollEnd ,5
Counter = 0
objlistcount = SwfWindow("–").SwfComboBox("–").GetItemsCount
For i = 0 to objlistcount-1
objitemval = SwfWindow("–").SwfComboBox("–").GetItem(i)
IF objitemval = Trim(sData1)Then
SwfWindow("–").SwfComboBox("–").Select sData1
Reporter.ReportEvent micPass, "Data : " & sData1 & "successfully selected" , "Pass"
Counter = 1
Exit For
End If
Next
IF Counter <>1 Then
Reporter.ReportEvent micPass,"Data :"& sData1 & "Not Present in the List","Step Failed"
End If
''&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&Well Mike, as the issue of autoscrolling seems to be resolved, i would like to know is this the only way or there is better way of identifying the object without using vScroll.
Swftypename for SwfObject = SRDashSolution.PhoneManagmentModule.OnePageView
-Nooruddin
Automation, HP-IT -
0
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.
-
0
Noruddin,
Case CAS-63752-GVG0LN was created for this and I reached out to you to get the information that Mike has requested through the case. You can see this case from the My Support Activity page.
Let me know if you have any questions with this matter.
-
0
Thanks Mike,
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
-
0
Hi Nooruddin,
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?
-
0
Thanks Mike,
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 , False
SwfWindow("SR-Dash").SwfComboBox("List_Severity").Select "Medium"SwfWindow("SR-Dash").SwfComboBox("List_Priority").SetProxySetting AutoScrollIntoView , False
SwfWindow("SR-Dash").SwfComboBox("List_Priority").Select "High"SwfWindow("SR-Dash").SwfButton("Button_CreateCase").SetProxySetting AutoScrollIntoView , False
SwfWindow("SR-Dash").SwfButton("Button_CreateCase").ClickRegards
Nooruddin
-
0
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.
-
0
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!
-
0
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
Nooruddin
Automation – HPIT
-
0
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.
-
0
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
-
0
Hi 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.
Thanks
Nooruddin
-
0
Nooruddin –
Mouseevent helped to scroll down. However, I have tables of different length at each time. I am failing to arrive at a good number of scrolls (to pass into Mouse scroll event).
I do not see the table as a WpfTable. Object spy only shows and QTP only recognizes the control as WpfObject !
As I was trying to explain in the previous post, I am now given a feature to sort the column by double clicking on the column header. so then I dont need to scroll down but sort in descending order and get the first row's interested column value (using getcelldata).
So I have a different issue now..Not the scrolling but to sort by double click on the column header (of the WpfObject). I cant access the columnheader by any means. When I try to record sorting step, it gets recorded as WpfWindow("Window1").WpfObject("Object1").Click 611, 15. This doesnt help since the columns are so adjacent to each other, replay ends up cliking on the wrong column always..and I need to double click.. not just Click.
🙁 thats where am stuck now! Thanks again!
-
0
Hi Sasha,
If my understanding is correct.. you are actually facing issue with double click on the column header so that you can sort and retreive the max value. Also you said that the click action is not reliable and clicking the wrong column..
Please try the below code and check.. If required slightly modify(I mean you can add or subtract for x and y axis).Below code has worked for me with winobject methods where normal recording and click was not reliable to get the edit box activated.
You need to pass the object which you need to click..You can also use descriptive way to identify the object you need to click.
If possible can you attach the screen shot of your table under test so that i can visually understand the problem you are facing and probably i can tell my logic or way of approaching to the issue.. It shall help a lot it debugging…
Public Function funcDeviceClick(ByRef obj)
Dim x1, y1, dr
x1 = -1
y1 = -1
If (Not isNull( obj)) And obj.Exist(5) Then
x1= obj.GetROProperty("abs_x") + obj.GetROProperty("width")/2
y1= obj.GetROProperty("abs_y") + obj.GetROProperty("height")/2
If x1 > 0 and y1 > 0 Then
Set dr = CreateObject("Mercury.DeviceReplay")
dr.MouseClick x1, y1,micLeftBtn
'dr.MouseClick x1, y1,micLeftBtn '' Uncomment this if you want double click
'Reporter.ReportEvent micDone, "check x y", " x = " & x1 & ", y = "& y1
Wait 1
Set dr = Nothing
End If
Else
Reporter.ReportEvent micFail, "Device Click Failed", "Not able to find the object"
End If
End FunctionThanks
Nooruddin
-
0
Thanks for the reply, Nooruddin. The application provided an export to excel feature and I am able to do my sorting and max value from the xported excel than the Wpf grid. I would be in touch since I am dealing with a lot of WpfGrids.
I really appreciate your quick reply!
Thanks,
Sasha
-
0
Hi,
I am using QTP 11.0 and AUT is .NET application with infragistics controls. I am facing the same issue for scrolling, i need to manually scroll down while executing the script.
The wierd thing is QTP is not generating any error while performing any action on the objects which are not visible
I tried using objCmb.SetProxySetting AutoScrollIntoView , False but it is giving me error "Object reference not set to an instance of an object."
I have an application where I need to select values in multiple combobox objects, some of them to be selected without scrolling, some of them after scrolling so I can't use vscroll micscrollEnd method. I am using a loop to select values in all the combobox objects so cant use vscroll method statement.
Is there any other option for this problem ??
-Maulik
-
0
Hi,
Swftype name is "Infragistics.Win.UltraWinGrid.UltraCombo" and Container is a dialogue box which has number of dropdown and edit controls and is identified as SwfObject.
I corrected my code and tried with
SwfWindow("").SwfWindow("").SwfObject("swfname:=xxxInputControl").VScroll micLineNext , 2
objCmb.SetProxySetting "AutoScrollIntoView" , False
objCmb.SetFocus
objCmb.Select strVal
But still the vertical scroll bar moves up automatically.
-
0
The script is
Set objCmb=SwfWindow("xxx").SwfWindow("yyy").SwfComboBox(oDesc)
strIndex=strInput-1
strSelectVal = objCmb.GetItem(strIndex)SwfWindow("xxx").SwfWindow("yyy").SwfObject(oDesc2).VScroll micLineNext , 2
objCmb.SetProxySetting "AutoScrollIntoView" , FalseobjCmb.SetFocus
objCmb.Select strSelectValobjCmb.Type micTab
wait(2)
Set objCmb = NothingScreenshot of the application is attached.
While execution of script after "objCmb.SetFocus" step, the vertical scroll bar moves up automatically.
-
0
Hi Maulik,
Its very simple, Try to use DOM concept and it should work.
In your case please objCmb.object.Focus
For most of the objects you try uinsg object.Focus rather than .SetFocus. Its been working great for us.
Please do let us know if still it doesnt works
Thanks
Nooruddin
-
- You must be logged in to reply to this topic.
Suggested Discussions
Nested dynamic objects
Apologies in advance, the work VM I do the coding on doesn’t have internet access nor let me …Binding .MVC Grid to Grid objects using JSON on button click
@(Html.Infragistics() .Grid(Model) .ID("Grid") .Height("500px") .Width("10…Does igx-grid support filtering from a column with an array of objects?
Hi, Does igx-grid support filtering from a column with an array of objects? For example, if rows ar…UFT is unable to recognize the objects by using object spy
UFT is unable to recognise the objects while using object spy and it is able to access the objects …Tags
No tags
Created by
Created on
Oct 27, 2012 12:51 PM
Last activity on
Feb 25, 2026 9:17 AM