naru 0 Posted March 16, 2019 Share Posted March 16, 2019 I am filling empty text box in IE using this code : #include <IE.au3> $oIE = _IEAttach ("Home") _IELoadWait($oIE) Local $oStockKg = _IEGetObjById($oIE, "txtbuyingstockinkg0") Local $iOutStanding, $iKg, $iGram, $oStockKg, $oStockGram, $sStockKg, $sStockGram Local $oTds, $oTrs = _IETagNameGetCollection($oIE, "tr") If IsObj($oTrs) Then For $i = 1 To $oTrs.Length $oTr = $oTrs($i) $oTds = _IETagNameGetCollection($oTr, "td") If IsObj($oTds) And $oTds.Length = 5 Then $iOutStanding = $oTds(1).InnerText $iKg = StringLeft($iOutStanding, StringInStr($iOutStanding, ".")-1) $iGram = StringTrimLeft($iOutStanding, StringInStr($iOutStanding, ".")) $sStockKg = $oTds(3).FirstElementChild.getAttribute("id", 2) $oStockKg = _IEGetObjById($oIE, $sStockKg) If IsObj($oStockKg) Then if $oStockKg.Value <> "" then ContinueLoop $oStockKg.Value = $iKg _IEAction($oStockKg, "Click") EndIf $sStockGram = $oTds(4).FirstElementChild.getAttribute("id", 2) $oStockGram = _IEGetObjById($oIE, $sStockGram) If IsObj($oStockGram) Then $oStockGram.Value = $iGram _IEAction($oStockGram, "Click") EndIf EndIf Next $btnnext = _IEGetObjById($oIE,"btnnext") _IEAction($btnnext,"click") EndIf But i want to don't run this code if all (Sugar, Oil) outstanding amounts = 0.000 Inspect Element of outstanding amount value <td>0.000</td> Link to post Share on other sites
Danp2 1,258 Posted March 17, 2019 Share Posted March 17, 2019 I would use _IETableWriteToArray to gather the table details into an array and then process the array to perform any value comarisons. WebDriver UDF [GH&S] Latest version Wiki FAQs Link to post Share on other sites
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