Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

How to Select an IE Tab and to Get the Selected IE Tab?

$
0
0

In this script below, I'm trying to:

  1. Create an Internet Explorer, and to navigate it to a blank page.
  2. Create a new tab with a blank page.
  3. Create another tab again. (Please don't ask me why 'cause it's just a test.)
  4. Get all the 3 object variables pointing to those 3 InternetExplorer Objects.
  5. And to test to select the tab two, then to select the tab one which is fail!
AutoIt         
#include <IE.au3> $oIE = _IECreate("about:blank", 0, 1, 1, 1) __IENavigate($oIE, "about:blank", 0, 0x800) __IENavigate($oIE, "about:blank", 0, 0x800) Local $oTabs[1] Local $i = 1 While 1    $oTabs[$i - 1] = _IEAttach($oIE, "instance", $i)    If @Error = $_IEStatus_NoMatch Then       ReDim $oTabs[$i - 1]       ExitLoop    EndIf       ReDim $oTabs[$i + 1]       $i += 1 WEnd Sleep(3000) _IEAction($oTabs[1], "focus") Sleep(3000) _IEAction($oTabs[0], "focus")

Could you please tell me how to fix that AU3 code to select and not to WinActivate() the tab because as far as I know, activating tab will make this tab at the front of the your Windows screen which I do not want because I want to automate the IE even I'm working on a different application.

 

Now, this is my second question! How can I get the current selected tab on a web browser, specially in Internet Explorer, even I'm in another application to read that tab's text using the _IEBodyReadText() libfunction? Thanks for any help!


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>