spoo Posted May 11, 2018 Share Posted May 11, 2018 Hello , i Don't know how to explain what is my requirement , but will try my best . i want to take out keyword "Note" and () and replace it with blank on Actual Requirement field once this step is completed for all the 10 blocks , i will have to click on "next5" button (present bottom right Conner) and repeat the same step . my code works fine for 1st 10 block but when i click on "next5" button its doesn't do the required task.. here is my output from console... Part Accountability Shim If and As Required BACS40R006C062F - Ref FL1 Diameter - Min/Max .159 - .165 Break Sharp Edges per BAC5300 Rivet Installation BACR15CE5D Trim .030 MAX - Ref FL2 Trim .030 MAX - Ref FL3 Trim .030 MAX - Ref FL4 Trim .030 MAX - Ref FL5 Part Accountability --------------------------------------->"problem" my loop again iterates for previous 1st 10 items and not for the next set of fresh items Shim If and As Required BACS40R006C062F - Ref FL1 Diameter - Min/Max .159 - .165 etc till ..Trim .030 MAX - Ref FL5 ---------------------------------------------------------------- #include <IE.au3> ; code to fetch number of sheets $oIENew = _IEAttach("https://www.net-inspect.com/FAIRForm3.aspx","url") $oForm =_IEFormGetObjByName($oIENew, "FAIRForm3") Local $oInputs = _IETagNameGetCollection($oForm, "input") For $oInput In $oInputs If $oInput.Name = "intTotPages" Then $sheet=$oInput.value ; ConsoleWrite($sheet) ExitLoop EndIf Next ;code to fix characteristics and naviage to next page based on no_of_sheets for $j=1 to $sheet for $i=1 to 10 $oForm =_IEFormGetObjByName($oIENew, "FAIRForm3") $oSelect = _IEFormElementGetObjByName($oForm, "MeasurementType" & $i) $oinput=_IEFormElementGetValue($oSelect) $oControlComment = _IEFormElementGetObjByName($oForm,"BubbleNumber" & $i) $text = _IEFormElementGetValue($oControlComment) ;$text1=StringStripWS ("$text",1) If $text <> "" Then $oForm1 =_IEFormGetObjByName($oIENew, "FAIRForm3") If $oinput<>"Variable" Then $oControlReq = _IEFormElementGetObjByName($oForm1,"DwgReqt" & $i) $text = _IEFormElementGetValue($oControlReq) $sOutput = StringRegExpReplace($text,'(Note)|[()]','') ConsoleWrite($sOutput & @CRLF) _IEFormElementSetValue($oControlReq,$sOutput) EndIf Else ExitLoop EndIf Next If $j<$sheet Then;; check this Run(@ScriptDir & "/closemsgbox.exe") $oControl=_IEGetObjByName($oIENew,"next10button") _IEAction($oControl,"click") ConsoleWrite("next5 started") _IELoadWaitTimeout(5000) EndIf Next Link to comment Share on other sites More sharing options...
Danp2 Posted May 11, 2018 Share Posted May 11, 2018 7 hours ago, spoo said: $oIENew = _IEAttach("https://www.net-inspect.com/FAIRForm3.aspx","url") $oForm =_IEFormGetObjByName($oIENew, "FAIRForm3") Local $oInputs = _IETagNameGetCollection($oForm, "input") For $oInput In $oInputs If $oInput.Name = "intTotPages" Then $sheet=$oInput.value ; ConsoleWrite($sheet) ExitLoop EndIf Next Couldn't this be simplified like this -- $oIENew = _IEAttach("https://www.net-inspect.com/FAIRForm3.aspx","url") $oForm =_IEFormGetObjByName($oIENew, "FAIRForm3") $oInput = _IEFormElementGetObjByName($oForm, "intTotPages") $sheet=$oInput.value Quote _IELoadWaitTimeout(5000) What are you trying to accomplish here? Latest Webdriver UDF Release Webdriver Wiki FAQs 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