Queener Posted February 18, 2014 Share Posted February 18, 2014 Func Start();click on the span drop-down-menu Local $sMyString = "Logs" Local $sMyString2 = "ESD" Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks Local $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") Second() EndIf Next EndFunc Can someone point me to the right direction why I'm getting: "C:\Users\aq\Desktop\Vision.au3" (22) : ==> Variable must be of type "Object".: For $oLink In $oLinks For $oLink In $oLinks^ ERROR Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
Danp2 Posted February 18, 2014 Share Posted February 18, 2014 Try adding some error checking after your call to _IELinkGetCollection. See the help file for details. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
jdelaney Posted February 18, 2014 Share Posted February 18, 2014 You can do error handling. What other error data is ouputed? If IsObj($oLinks) Then For $oLink In $oLinks Local $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") Second() EndIf Next EndIf IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Queener Posted February 18, 2014 Author Share Posted February 18, 2014 jdelaney, thats the only error I'm getting. By using your code; I receive no error, but it also doesn't run the next function which is second(). Second function is to delete the xls file. Func Second() ;delete xls file and go to next function if FileExists($loc & "\*.xls") Then FileDelete($loc & "\*.xls") sitepress Else sitepress EndIf EndFunc Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
jdelaney Posted February 18, 2014 Share Posted February 18, 2014 (edited) There are either no links on your page, or they are inside frames. Or, maybe you are referencing the wrong $oIE. Or, maybe the page hasn't fully loaded...maybe loop until there is a collection. Not enough information, you have to provide more. Edited February 18, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Queener Posted February 18, 2014 Author Share Posted February 18, 2014 talk too soon. --> IE.au3 T3.0-1 Error from function _IELoadWait, $_IEStatus_InvalidObjectType () Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
jdelaney Posted February 18, 2014 Share Posted February 18, 2014 Seems to be an issue with your $oIE, then. Since you didn't post how you created/attached, or attempted to do so, we can only guess....see post #5 again. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Solution Queener Posted February 18, 2014 Author Solution Share Posted February 18, 2014 (edited) Global $sURL = "http://vision/index.aspx" Global $oIE = _IECreate($sURL, 0, 1, 1, 1) this is what I have. It's our cooperate intranet site so you guys won't be able to access it. EDIT: Strange, If i'm outside of the domain, it works fine. But if I joined domain, I get that error. New EDIT: Found my own answer... For some odd reason, it required to run as Admin. Edited February 18, 2014 by asianqueen Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") 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