Masush Posted February 20, 2013 Share Posted February 20, 2013 $ie=_IECreate("about:blank",0,1,1) _IELoadWait($ie,1,1) _IENavigate($ie,"http://www.ramdomsite.com/t/") Global $oForms = _IEFormGetCollection($ie) For $oForm In $oForms If $oForm.action = "https://mobile.twitter.com/session" Then Local $sform = $oForm Next Local $oText = _IEFormElementGetObjByName($sform, "username") if $oText=$_IEStatus_NoMatch Then MsgBox(1,"","hmm") THis is my Script It fail to find the element And makes a error Local $oText = _IEFormElementGetObjByName(^ ERROR how to make condition to ignore it and continue if it dont find element i tried if $oText=$_IEStatus_NoMatch Then MsgBox(1,"","hmm") and tried other like if $oText=7 Then MsgBox(1,"","hmm") But it didn;t worked Please Help me thanks Link to comment Share on other sites More sharing options...
Danp2 Posted February 20, 2013 Share Posted February 20, 2013 The way you have your routine written, $sform isn't declared if the For... Next loop doesn't find the desired form. Suggest that you either rewrite so that the variable is declared at the top of your script or else use IsDeclared() to test for the existence of the variable. Masush 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Masush Posted February 21, 2013 Author Share Posted February 21, 2013 oh thank you alot i got it I wil test it Now Thanks DanP2 Link to comment Share on other sites More sharing options...
Masush Posted February 21, 2013 Author Share Posted February 21, 2013 Thanks it worked Before i used "If" Condition to check tittle for skiping codes.. Thanks again,i forgot to declare. such a simple mistake 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