Automationaddict Posted December 1, 2018 Posted December 1, 2018 I have designed an App using Koda wherein I have different buttons for different URLs. The problem is every url opens in different window and not in different tabs. Please suggest me the entire code to check if there in an open window in IE, then open the next url in next tab and if not then open a new window. Thanks in advance.
Danp2 Posted December 1, 2018 Posted December 1, 2018 Lots of examples on the forum. Here's one -- Latest Webdriver UDF Release Webdriver Wiki FAQs
Automationaddict Posted December 1, 2018 Author Posted December 1, 2018 As I am a beginner I do not know much. I am unable to understand from this reference. Can you please send me the code so that I can go through it
Danp2 Posted December 1, 2018 Posted December 1, 2018 The code is already listed in that thread. You should try running it to see how it works. P.S. Pay attention to the lines containing Navigate2 and $navOpenInNewTab, Latest Webdriver UDF Release Webdriver Wiki FAQs
Automationaddict Posted December 1, 2018 Author Posted December 1, 2018 Thanks for your reply and time for my query but I don’t know whether I am able to explain my question or not. It is user dependent as may be this happens that when the user is clicking on a particular button, then IE is not there, in that case we have to open a new window But when IE is opened maybe in his/her second, third... attempt then we need to attach a new tab to the existing window. And i am sorry but I didn’t understand this code and particularly this: Const $navOpenInNewTab = 0x0800
Danp2 Posted December 1, 2018 Posted December 1, 2018 That line just declares a constant, which is then used in the subsequent command. You should be able to do something like this to determine if the browser is already active -- $oIE = _IEAttach("", "instance", 1) If IsObj($oIE) Then ; Open new tab $oIE.Navigate2('http://google.com', $navOpenInNewTab) Else ; Launch browser $oIE = _IECreate("google.com") EndIf Latest Webdriver UDF Release Webdriver Wiki FAQs
Automationaddict Posted December 1, 2018 Author Posted December 1, 2018 How can I be so stupid!! This code is exiting abruptly and I could not figure out what's actually goes out missing. Is there any problem with : $oIE = _IEAttach("", "instance", 1) However, I tried this code,it is running successfully in new tab but at the beginning it creates a blank tab which looks wierd. $navOpenInNewTab = 0x0800 $navOpenInBackgroundTab = 0x1000 $oIE = ObjCreate("InternetExplorer.Application") $oIE.Visible = True $oIE = __IENavigate($oIE, "www.google.com", 0, 0x800)
FrancescoDiMuro Posted December 1, 2018 Posted December 1, 2018 @Automationaddict First, use the Code tag to insert code in your posts. Then, Danp2 has already gave you some hint to work on. Looking in the Forum, you can see this post either, which it could be helpful in your case. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Automationaddict Posted December 2, 2018 Author Posted December 2, 2018 Thanks a lot everyone (especially Danp2) for helping me with the Autoit coding. I just executed my code successfully. Thanks once again..
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