Any way to retrieve the clicked web page element?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
phyrburn
Posts: 13
Joined: 24 Jul 2019, 05:55

Any way to retrieve the clicked web page element?

04 May 2021, 06:21

Hi all,

Firstly, I apologise for the long post. I needed to supply a little background, and what I have looked into myself. TL;DR at the bottom.

I have an application I wrote some time ago that's used within my workplace to assist us in using our web based job tracking service.
Image
[Mod edit: Image fixed.]
The screenshot shows a bit of what we use. Click the play button to start a job. That job moves up into a "personal" queue and gets a stop button to complete the job. We currently are stuck on Internet Explorer. So I am using a combination of #IfWinActive, MouseGetPos, ControlGetText and the IEGet() function from Jethrow. I am grabbing the element that is under the mouse cursor, triggered with left click. I check the value of the inner text to see which button, stop or play, has been clicked and perform the required actions. It's been very reliable for some time now, but with IE being removed from Windows, I have been asked to update the app to support Edge, Chrome and Firefox.

The Chrome.ahk library is most likely not an option here as I am serving multiple departments in 3 different countries. I cannot get everybody to set Chrome up in debug mode. And what I can get approved by my local I.T. team may not be approved by overseas teams. And the obvious point, I can't use Chrome.ahk for Firefox.

Selenium is the other route I have looked into, and the same I.T. team potential issues stand. I also was not able to find out any information regarding the legality of packaging the web driver with my application. I have also seen a lot of issues where a browser updates and requires an updated webdriver. Timezones mean it could be a full day of non functionality for a team before I could perform the update.

I've tinkered around with ACC. This works in Firefox to get web elements. Comparing the address to a known address to get the element clicked. But the address for the buttons changes for some reason. Rendering order perhaps? No idea. But it means I can't reliably predict the address. And it takes 3-6 seconds to retrieve the address of the element clicked. Unacceptable as a user may click stop and then play on the next job within that time.

ACC in Chromium doesn't seem to have any access to the web page. It sees the rendered window and no sub elements with in it. Unless I am missing something here.

I have been using JEE_AccGetPath() & JEE_AccGetTextAll() from jeeswg to check ACC access.

TL;DR
So the question is; is it possible for me to retrieve the web page element that has been clicked on, or is currently under the mouse cursor, within Edge, Chrome AND Firefox? Chrome.ahk and Selenium don't appear to be suitable.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada and 252 guests