0

I have a problem with accessing 3 buttons on a webpage since they don't belong to the DOM and I cannot fetch them using ID or any other "anchor". These are ActiveX buttons from what I can see in the DOM tree, but I have no idea how to reach to them. As for now, the only (stupid) workaround is to loop through all the items using on the page by SendKeys {TAB} and pressing space on each of them. Only those buttons react to the space key, but it's not a reliable solution, so I want find something proper. I'm attaching the DOM screen from the area where they are placed on the page and the code where I think there are sitting.

View in the browser - out of DOM

ActiveX Control Area

<DIV id=divDragDrop style="HEIGHT: 200px; WIDTH: 700px; TEXT-ALIGN: left">
  <!-- -------- DRAG/DROP ACTIVEX CONTROL AREA -------- -->
<OBJECT id=DragDropActiveX style="HEIGHT: 200px; WIDTH: 700px; LEFT: 0px; TOP: 0px; VISIBILITY: visible" name=DragDropActiveX codeBase="DragDropControl.dll" classid=clsid:b7e10a13-86c9-43af-9d8a-aa153b0470c8 enableviewstate="true">
<PARAM NAME="ClaimNumber" VALUE="0004887564">
<PARAM NAME="FileNoteNumber" VALUE="D3EFC3275F4ACA9D">
<PARAM NAME="FileNoteCategory" VALUE="COV">
<PARAM NAME="FileNoteSubcategory" VALUE="FNOL1">
<PARAM NAME="FileUploadServiceURL" VALUE="https://xlgc.r02.xlgs.local:443/Desktop/FileNotes/FileAcceptorForDragAndDrop.aspx?UserId=A135604">
<PARAM NAME="AllowedFileTypes" VALUE="doc.gif.htm.html.jpeg.jpg.pdf.rtf.tif.tiff.txt.xls.zip.fdf.xfdf.asp.asf.asx.aiff.au.dwg.dxf.dwf.atd.bmp.cvs.cfm.cfml.cgi.emz.cgm.csv.dec.dib.dcm.dtd.daf.eps.msg.fpx.xml.fos.mif.hdml.pcl.idl.xsf.xsn.one.ppt.mps.mpt.mpw.rmh.vsd.vss.vst.vsw.dot.dgn.mod.mp3.mpg.mpg2.mp4.mxf.pgm.ppm.soc.oft.pcx.pff.php.php3.phtml.pct.png.ps.pro.ptd.mov.ra.rm.ram.rmm.rnx.rv.svg.sct.scm.shtml.spml.stm.spl.swf.sgi.mht.smil.ras.sun.tga.avi.vrf.voc.wrl.wsdl.emf.jnt.wma.wax.wmv.wvx.wmf.wbmp.wpd.xfm.att.rls.rlx.ctm.hhf.mcr.tbr.ent.pen.xsd.elm.xsl.afp.cr2.crw.dita.dng.docm.docx.dotm.dv.eap.emcmf.f4v.flv.gxf.lxf.mdi.mmap.mmas.mmat.mss.odt.opml.pnm.pptx.pub.rle.ump.xlsb.xlsm.xlsx.xmi.pcd.eml">
<PARAM NAME="IsDirty" VALUE="False">
<PARAM NAME="MaxFileSizeInBytes" VALUE="">
<PARAM NAME="DraftVisible" VALUE="True">
<PARAM NAME="AutoSize" VALUE="False">
<PARAM NAME="AutoSizeMode" VALUE="GrowOnly">
<PARAM NAME="AutoValidate" VALUE="EnablePreventFocusChange">
<PARAM NAME="BorderStyle" VALUE="None">
<PARAM NAME="CurrentAutoScaleDimensions" VALUE="6, 13">
<PARAM NAME="AutoScroll" VALUE="False">
<PARAM NAME="AutoScrollMargin" VALUE="0, 0">
<PARAM NAME="AutoScrollMinSize" VALUE="0, 0">
<PARAM NAME="AccessibleDescription" VALUE="">
<PARAM NAME="AccessibleName" VALUE="">
<PARAM NAME="AccessibleRole" VALUE="Default">
<PARAM NAME="AllowDrop" VALUE="False">
<PARAM NAME="Anchor" VALUE="Top, Left">
<PARAM NAME="AutoScrollOffset" VALUE="0, 0">
<PARAM NAME="BackColor" VALUE="233, 238, 255">
<PARAM NAME="BackgroundImage" VALUE="">
<PARAM NAME="BackgroundImageLayout" VALUE="Tile">
<PARAM NAME="CausesValidation" VALUE="True">
<PARAM NAME="Cursor" VALUE="Default">
<PARAM NAME="Dock" VALUE="None">
<PARAM NAME="Enabled" VALUE="True">
<PARAM NAME="Font" VALUE="Arial, 11world">
<PARAM NAME="ForeColor" VALUE="Black">
<PARAM NAME="Location" VALUE="280, 652">
<PARAM NAME="Margin" VALUE="3, 3, 3, 3">
<PARAM NAME="MaximumSize" VALUE="0, 0">
<PARAM NAME="MinimumSize" VALUE="0, 0">
<PARAM NAME="Name" VALUE="DragDropControl">
<PARAM NAME="RightToLeft" VALUE="No">
<PARAM NAME="Size" VALUE="875, 250">
<PARAM NAME="TabIndex" VALUE="0">
<PARAM NAME="TabStop" VALUE="True">
<PARAM NAME="Tag" VALUE="">
<PARAM NAME="UseWaitCursor" VALUE="False">
<PARAM NAME="Visible" VALUE="True">
<PARAM NAME="PreferredSize" VALUE="685, 196">
<PARAM NAME="Padding" VALUE="0, 0, 0, 0">
<PARAM NAME="ImeMode" VALUE="NoControl">
</OBJECT>
  <!-- ATTENTION: hDragDropState below is required for DragDropActiveX -->
  <INPUT id=ctl00_MainContent_hDragDropState type=hidden name=ctl00$MainContent$hDragDropState>
  <!-- ----- END DRAG/DROP ACTIVEX CONTROL AREA ------- -->
</DIV>

Thanks!

JakubTracz
  • 27
  • 2
  • 8
  • Unfortunately I have no idea about ActiveX controls in web pages. Even though I find the problem interesting, this is a really old technique. I suppose it is a company internal page in the intranet. As far as I can see, you can directly control the ActiveX Object visible in the HTML image via its ID `divDragDrop`. But if I'am right this is the text field, (width 700px, height 200px). – Zwenn Oct 22 '20 at 22:24
  • The HTML code for the three buttons is not visible. It would be helpful if you could post the whole HTML source code as HTML snippet. As a graphic it is really hard to do anything with it. I assume that the methods can be called via the `DragDropControl.dll` The only question is what is in there and how to use it. Of course you need the dll for the buttons if there is one. – Zwenn Oct 22 '20 at 22:24
  • The buttons are presumably tied to events. Try to track the events perhaps? If you can determine which framework is implementing this it might help in tracking down a testable example. Have you checked it isn't a third party application? – QHarr Oct 22 '20 at 22:38
  • I have also thought about events. But I miss the little grey buttons `event` in the screenshot, which I know from the DOM Inspector of FireFox. What I found in a german document goes in that direction. But it can be everything and nothing. ` – Zwenn Oct 22 '20 at 22:48
  • Ok, maybe the screenshot was made with IE. There the mentioned grey buttons `event` do not exist. Jacub, can you do such a screenshot of the buttons HTML again with another browser? Please do so with the event list displayed, if available. For FireFox you can see what I mean here: https://stackoverflow.com/questions/63294113/automate-ie-via-excel-to-fill-in-a-dropdown-and-continue/63299608#63299608 – Zwenn Oct 22 '20 at 23:11
  • @JakubTracz, I suggest trying to post the HTML code of those buttons instead of posting the image of the code. We can make some tests with it and check whether it is possible to click the button. The above posted has some unnecessary code that creates confusion. Also, try to post your VBA code so that we can see what actually you are trying on your side. It may help to narrow down the issue. – Deepak-MSFT Oct 23 '20 at 01:37
  • I've added the HTML code snippet where I think those buttons are sitting. I cannot take the code from other browser than IE because the page doesn't render correctly (I cannot even access this tab in Chrome). I hope it can help you solve this. – JakubTracz Oct 24 '20 at 22:00
  • I try to check the code and it looks like the code is for the Attachment drag and drop control. I did not see any code for those 3 buttons. Are you able to see any other code for buttons after the posted code? If there is no code for buttons then I think using the `Sendkeys()` can be the workaround for this issue. that you are already doing. – Deepak-MSFT Oct 26 '20 at 08:50

0 Answers0