jisevereid Posted January 20, 2017 Share Posted January 20, 2017 I have 2 scripts that gets the current IE window and directs it a webpage. The problem that I am having is that often times there is more than one tab open and my script won't work properly when the focus is on the second tab. To try and fix this I am trying to send IE the command to change to the first tab which is "Control + 1" and then navigate to the desired link. However, I cannot seem to get my script to change to the first tab before navigating to the link. This is my first script #include <IE.au3> #AutoIt3Wrapper_run_debug_mode=Y Func IE_Navigate_Map() Local $title = WinGetTitle ("[CLASS:IEFrame]") Local $trimTitle = StringTrimRight($title, 20) Local $oIE = _IEAttach($trimTitle) _IENavigate($oIE, "https://www.google.com/maps/d/viewer?mid=1itdKt_5_qG_pIxM5N49qNK55rkM&ll=43.84185846009771%2C-91.24873084573369&z=9") EndFunc Send("^1") IE_Navigate_Map() This is my second script #include <IE.au3> #AutoIt3Wrapper_run_debug_mode=Y Func IE_Navigate_Web() Local $title = WinGetTitle ("[CLASS:IEFrame]") Local $trimTitle = StringTrimRight($title, 20) Local $oIE = _IEAttach($trimTitle) _IENavigate($oIE, "http://www.explorelacrosse.com/") EndFunc Send("^1") IE_Navigate_Web() Link to comment Share on other sites More sharing options...
Danp2 Posted January 20, 2017 Share Posted January 20, 2017 If you know the URL for the desired tab, then you can use _IEAttach like this: $myURL = "google.com" $oIE = _IEAttach($myURL, "URL") If that doesn't work in your situation, then you may find your answer in this thread. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Juvigy Posted January 23, 2017 Share Posted January 23, 2017 Try it like this : $oIE = _IEAttach("", "instance", 1) This one attaches to the first instance/tab. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now