Sign in to follow this  
Followers 0
gspot

Finding and accessing elements in a browser CRM aplication

22 posts in this topic

Hi,

Im trying to manipulate a browser CRM aplication (siebel). I tried to find the elements with Developer Tools of the IE (printscreen atached). I want to click on a button (id=s_2_1_10_0_mb), i tried the fowling code but no success 

Local $oForm = _IEFormGetObjByName($oIE, "SWEForm2_0")
    ;Local $oForm = _IEFormGetObjByName($oIE, "_swecontent")

    Local $oInputFile = _IEFormElementGetObjByName($oForm, "s_2_1_10_0_mb")
    IEAction($oInputFile, "click")

what am i doing wrong, any ideas?

thanks

post-86027-0-50412700-1402486902_thumb.j

sourcecode.htm

Share this post


Link to post
Share on other sites



The web page uses frames, so you need to use _IEFrameGetObjByName to get a reference to the desired frame before you can access the form.

Share this post


Link to post
Share on other sites

Yes, it appears that there are nested framesets, so you probably have to work your way down to the desired one first and then try to access the form.

Share this post


Link to post
Share on other sites

But there are lots and lots of frames and framesets  :sweating:  :)

Is there a simpler way?

Can someone give me an example?

Thanks a lot

Share this post


Link to post
Share on other sites

Wow, what a pain.  Who were the marketing wizards to come up with that website!

Sorry, no other path.


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Wow, what a pain.  Who were the marketing wizards to come up with that website!

Sorry, no other path.

 

LOL belive it thats a pain in the you know what... :)

Share this post


Link to post
Share on other sites

This thread probably can help you out 

Share this post


Link to post
Share on other sites

This thread probably can help you out 

Yes, it seems it can help me, a little advanced for me, but i will try to understand it :)

Thanks

Share this post


Link to post
Share on other sites

if you need help just post the results of the simplespy as that gives the basic information to find the information you need to control the objects

example 8 will give you a good start

example 11 is the most abstracted version compared to all other examples but as with all simplified abstractions you have less power to do all commands

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Hi!

I'm giving a try at this one once more. I try to click button "Consultar".

I use an internet tool that give me the following path/information to button:

Index: 49

id: s_2_1_10_0_mb

Innertext: Consultar

Outer Html: <A id=s_2_1_10_0_mb onmouseup=MinibtnUp(this.parentNode) onmouseover=MinibtnHover(this.parentNode) onmouseout=MinibtnOut(this.parentNode) onmousedown=MinibtnDown(this.parentNode) onclick="App().InvokeControlMethod('', 'PTC Todas Solicitacoes Service Request List Applet', 'NewQuery'); return false;" href="javascript:void(0)">Consultar</A>

FRAME - index - Name

Frame.1 - 27 - _sweclient

Frame.2 - 11 - _swecontent

Frame.3 - 12 - _sweview

Frame.4 - 5 - _svf1

 

I also have tried this  code with some variations... with no results

Local $oIE = _IECreate("http://somesite.com", 1)
        If @error <> 0 Then
            _erro("1 - Error: " & @error)
            ContinueLoop
        EndIf

    Local $oFrame1 = _IEFrameGetObjByName($oIE, "_sweclient")
    Local $oFrame2 = _IEFrameGetObjByName($oFrame1, "_swecontent")
    Local $oFrame3 = _IEFrameGetObjByName($oFrame2, "_sweview")
    Local $oFrame4 = _IEFrameGetObjByName($oFrame3, "_svf1")
    Local $oForm = _IEFormGetObjByName($oFrame4, "SWEForm2_0")
    Local $obutton = _IEFormElementGetObjByName($oForm, "s_2_1_10_0_mb")

    ; Local $obutton = _IEFormElementGetObjByName($oFrame4, "Consultar")
;   Local $obutton = _IEGetObjByName($oFrame4, "s_2_1_10_0_mb")
    _IEAction($obutton, "click")

What am i doing wrong? any help will be appreciated.

Thanks

Edited by gspot

Share this post


Link to post
Share on other sites

We aren't mind readers. :geek: Post the results from the Scite output window so that we can see where the script is failing.

Share this post


Link to post
Share on other sites
   
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
"C:\Program Files\AutoIt3\Include\IE.au3" (1808) : ==> Variable must be of type "Object".:
Return SetError($_IEStatus_Success, $oTemp.GetElementsByTagName($s_TagName).length, $oTemp.GetElementsByTagName($s_TagName))
Return SetError($_IEStatus_Success, $oTemp^ ERROR
->14:23:35 AutoIt3.exe ended.rc:1
+>14:23:35 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 3.467

Share this post


Link to post
Share on other sites

Add some ConsoleWrite() commands after each line of the script so that we can determine which line is causing the error.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I haded trace lines to the code, and stops at line:   Local $oFrame1 = _IEFrameGetObjByName($oIE, "_sweclient")
 
 
 Scite output window:
 
@@ Trace(37) :     Local $oIE = _IECreate("http://somesite.com", 1)
>Error code: 0
 
@@ Trace(46) :     Local $oFrame1 = _IEFrameGetObjByName($oIE, "_sweclient")
"C:\Program Files\AutoIt3\Include\IE.au3" (1808) : ==> Variable must be of type "Object".:
Return SetError($_IEStatus_Success, $oTemp.GetElementsByTagName($s_TagName).length, $oTemp.GetElementsByTagName($s_TagName))
Return SetError($_IEStatus_Success, $oTemp^ ERROR
->17:44:43 AutoIt3.exe ended.rc:1
+>17:44:43 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 2.274
Edited by gspot

Share this post


Link to post
Share on other sites

So.... could be a bug in _IETagNameGetCollection, which is the routine where line 1808 occurs. Unfortunately, I don't have the time to try to replicate this.

Right now, you are the only one that can troubleshoot this. You should post a reproducer script that any forum member could run to allow others to help you.

Share this post


Link to post
Share on other sites

What you mean reproducer script ?

The problem is that im working on a corporate website, not accessible outside company...

Any ideas?

Thanks

 

Share this post


Link to post
Share on other sites

if you need help just post the results of the simplespy as that gives the basic information to find the information you need to control the objects

example 8 will give you a good start

example 11 is the most abstracted version compared to all other examples but as with all simplified abstractions you have less power to do all commands

 

Only now i had some time to do this. Yes i need help :) The simplespy give me the following:

Mouse position is retrieved 300-242
At least we have an element [Consultar][]
Having the following values for all properties: 
Title is: <Consultar> Class   := <> controltype:= <UIA_EditControlTypeId> ,<50004> , (0000C354)
*** Parent Information ***
Title is: <Consultar> Class   := <> controltype:= <UIA_HyperlinkControlTypeId> ,<50005> , (0000C355)
*** Detailed properties of the highlighted element ***
UIA_AcceleratorKeyPropertyId :=
UIA_AccessKeyPropertyId :=
UIA_AriaPropertiesPropertyId :=
UIA_AriaRolePropertyId :=
UIA_AutomationIdPropertyId :=
UIA_BoundingRectanglePropertyId :=283;233;46;13
UIA_ClassNamePropertyId :=
UIA_ClickablePointPropertyId :=
UIA_ControllerForPropertyId :=
UIA_ControlTypePropertyId :=50004
UIA_CulturePropertyId :=0
UIA_DescribedByPropertyId :=
UIA_DockDockPositionPropertyId :=5
UIA_ExpandCollapseExpandCollapseStatePropertyId :=3
UIA_FlowsToPropertyId :=
UIA_FrameworkIdPropertyId :=
UIA_GridColumnCountPropertyId :=0
UIA_GridItemColumnPropertyId :=0
UIA_GridItemColumnSpanPropertyId :=1
UIA_GridItemContainingGridPropertyId :=
UIA_GridItemRowPropertyId :=0
UIA_GridItemRowSpanPropertyId :=1
UIA_GridRowCountPropertyId :=0
UIA_HasKeyboardFocusPropertyId :=False
UIA_HelpTextPropertyId :=
UIA_IsContentElementPropertyId :=True
UIA_IsControlElementPropertyId :=True
UIA_IsDataValidForFormPropertyId :=False
UIA_IsDockPatternAvailablePropertyId :=False
UIA_IsEnabledPropertyId :=True
UIA_IsExpandCollapsePatternAvailablePropertyId :=False
UIA_IsGridItemPatternAvailablePropertyId :=False
UIA_IsGridPatternAvailablePropertyId :=False
UIA_IsInvokePatternAvailablePropertyId :=True
UIA_IsItemContainerPatternAvailablePropertyId :=False
UIA_IsKeyboardFocusablePropertyId :=True
UIA_IsLegacyIAccessiblePatternAvailablePropertyId :=True
UIA_IsMultipleViewPatternAvailablePropertyId :=False
UIA_IsOffscreenPropertyId :=False
UIA_IsPasswordPropertyId :=False
UIA_IsRangeValuePatternAvailablePropertyId :=False
UIA_IsRequiredForFormPropertyId :=False
UIA_IsScrollItemPatternAvailablePropertyId :=False
UIA_IsScrollPatternAvailablePropertyId :=False
UIA_IsSelectionItemPatternAvailablePropertyId :=False
UIA_IsSelectionPatternAvailablePropertyId :=False
UIA_IsSynchronizedInputPatternAvailablePropertyId :=False
UIA_IsTableItemPatternAvailablePropertyId :=False
UIA_IsTablePatternAvailablePropertyId :=False
UIA_IsTextPatternAvailablePropertyId :=False
UIA_IsTogglePatternAvailablePropertyId :=False
UIA_IsTransformPatternAvailablePropertyId :=False
UIA_IsValuePatternAvailablePropertyId :=True
UIA_IsVirtualizedItemPatternAvailablePropertyId :=False
UIA_IsWindowPatternAvailablePropertyId :=False
UIA_ItemStatusPropertyId :=
UIA_ItemTypePropertyId :=
UIA_LabeledByPropertyId :=
UIA_LegacyIAccessibleChildIdPropertyId :=1
UIA_LegacyIAccessibleDefaultActionPropertyId :=Jump
UIA_LegacyIAccessibleDescriptionPropertyId :=
UIA_LegacyIAccessibleHelpPropertyId :=
UIA_LegacyIAccessibleKeyboardShortcutPropertyId :=
UIA_LegacyIAccessibleNamePropertyId :=Consultar
UIA_LegacyIAccessibleRolePropertyId :=42
UIA_LegacyIAccessibleSelectionPropertyId :=
UIA_LegacyIAccessibleStatePropertyId :=7340096
UIA_LegacyIAccessibleValuePropertyId :=javascript:void(0)
UIA_LocalizedControlTypePropertyId :=edit
UIA_MultipleViewCurrentViewPropertyId :=0
UIA_MultipleViewSupportedViewsPropertyId :=
UIA_NamePropertyId :=Consultar
UIA_NativeWindowHandlePropertyId :=0
UIA_OrientationPropertyId :=0
UIA_ProcessIdPropertyId :=6068
UIA_ProviderDescriptionPropertyId :=[pid:6068,hwnd:0x0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]
UIA_RangeValueIsReadOnlyPropertyId :=True
UIA_RangeValueLargeChangePropertyId :=0
UIA_RangeValueMaximumPropertyId :=0
UIA_RangeValueMinimumPropertyId :=0
UIA_RangeValueSmallChangePropertyId :=0
UIA_RangeValueValuePropertyId :=0
UIA_RuntimeIdPropertyId :=
UIA_ScrollHorizontallyScrollablePropertyId :=False
UIA_ScrollHorizontalScrollPercentPropertyId :=0
UIA_ScrollHorizontalViewSizePropertyId :=100
UIA_ScrollVerticallyScrollablePropertyId :=False
UIA_ScrollVerticalScrollPercentPropertyId :=0
UIA_ScrollVerticalViewSizePropertyId :=100
UIA_SelectionCanSelectMultiplePropertyId :=False
UIA_SelectionIsSelectionRequiredPropertyId :=False
UIA_SelectionselectionPropertyId :=
UIA_SelectionItemIsSelectedPropertyId :=False
UIA_SelectionItemSelectionContainerPropertyId :=
UIA_TableColumnHeadersPropertyId :=
UIA_TableItemColumnHeaderItemsPropertyId :=
UIA_TableRowHeadersPropertyId :=
UIA_TableRowOrColumnMajorPropertyId :=2
UIA_TableItemRowHeaderItemsPropertyId :=
UIA_ToggleToggleStatePropertyId :=2
UIA_TransformCanMovePropertyId :=False
UIA_TransformCanResizePropertyId :=False
UIA_TransformCanRotatePropertyId :=False
UIA_ValueIsReadOnlyPropertyId :=True
UIA_ValueValuePropertyId :=javascript:void(0)
UIA_WindowCanMaximizePropertyId :=False
UIA_WindowCanMinimizePropertyId :=False
UIA_WindowIsModalPropertyId :=False
UIA_WindowIsTopmostPropertyId :=False
UIA_WindowWindowInteractionStatePropertyId :=0

UIA_WindowWindowVisualStatePropertyId :=0

Share this post


Link to post
Share on other sites

Find a publicly accessible website that exhibits the same issues and post a full script that we could run to help you troubleshoot.

Share this post


Link to post
Share on other sites

Find a publicly accessible website that exhibits the same issues and post a full script that we could run to help you troubleshoot.

 

Thats almost impossible, its an CRM aplication only for business management like backoffice... thanks the same. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0