Skip to content

Replies

0
Nooruddin
Nooruddin answered on Oct 27, 2012 12:51 PM

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

0
Nooruddin
Nooruddin answered on Oct 25, 2011 5:50 PM

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 Function

 

Thanks

Nooruddin

0
Nooruddin
Nooruddin answered on Oct 25, 2011 4:49 AM

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
Nooruddin answered on Oct 24, 2011 5:42 AM

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
Nooruddin
Nooruddin answered on Apr 28, 2011 4:51 AM

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").Click

 

Regards

Nooruddin

 

0
Nooruddin
Nooruddin answered on Apr 20, 2011 6:11 AM

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
Nooruddin
Nooruddin answered on Apr 13, 2011 7:55 AM

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