Control UI doesn't work inside browser webframe. As most browser already sandboxed the inner webframe from external accessibility interaction. I use HTTP request to mimic what the browser does. I usually use Chrome developer option to help me tracing the post/get, sometimes using wireshark and sometimes bruteforce it directly using Automagic and debug dialog. It heavily requires Chrome debugging, regex, HTTP post/get, javascript, json and sometimes xml.
Mifi
For my mobile wifi router, mifi, as I posted here :
https://www.kaskus.co.id/show_post/5aad ... 568/6897/-
I open the webUI of the mifi. Then I study how it process the login from the chrome developer. After know it, I use standard HTTP POST with the form field username password to login into mifi. To query the data, I check which url it use to get the data. Using HTTP POST to this url will get the status result in json.
As some point, I need to reposition the mifi to get a better signal. So I plot the json into chart (widget with hundreds of rectangles), then show it in widget. I can then reposition the mifi and check if the signal becomes better or worse, to find the best position.
Mifi sometimes becomes slow, as typical network devices. My carrier also require me to restart the mifi before using night's quota. So I click the command to restart the mifi, find the url and use that url in HTTP request to restart the mifi. But just remember, most command only can be passed after the first successful login. Usually the router provide token or some identifcation id to maintain the session. So not everyone can simply post the restart url and immediately restart the router. We still need to pass the username password to login first before issuing command.
Other related to mifi flow, My subscription is quota based. I have to check my quota periodically to ensure I don't overuse my average daily usage (or I will run out of quota at the end of month). So I do the same, finding out method to login to the website, using regex to parse html and find the remainding quota. Later I found out the mifi also can check the quota without having to login. It turns out to use its own API with the mifi id + number hash to get the data. I mimic this and the flow becomes shorter and much faster then. The result also in json format, so I don't need to use long regex anymore.
Office Wifi
At the office wifi, I do approximately the same. Login to the router and find the restart url. When someone tell me the connection is down, a simple shortcut tap is enough to restart it; rather than having to open browser, login, navigate to the UI where the restart button located and click it.
When we still have 1 Mbps internet speed (yes, only 1 Mbps), and there are approx 25 devices; users complain a massive slowdown. After checking the router connected clients, I found some unknown devices from the outsider/neighbour office. I blacklisted those in the router, so they can't connect even they typed in the correct password. As far as I remember, that is the first time I heavily use regex to parse the router's connected devices list. Using Automagic, I can easily identify which devices are rogues ones, instead of looking one by one thru their mac address in the web UI. (which is very exhausting to do it everytime).
Other network related is the latest one I just finished last week, QRcode to track packages. I just tried it today and it is working fine so far. For this purpose, it is as easy as getting know the correct url with the tracking code. A simple debug dialog, copying to regex testes, replacing the variables with proper regex syntax, are enough to complete the flow.
Again, most of these flows are devices specific and most likely only for my own purpose. I use mifi Andromax M2S with Smartfren, Tplink Archer C7 v2 (which I don't automate); and at the office, the wifi router are ZTE F660 and Tplink WR740N (as secondary AP thru LAN). If you need to do the similar thing, you have to do it by your own. I can only guide at the big picture only.