MonicaLu Posted May 7, 2019 Share Posted May 7, 2019 I just started to use AutoIt. Could anyone help me how to click the link below? Thanks a lot. <li class="with-children closed" data-bind="template: template, css: {'disabled': isDisabled, 'with-children closed': hasChildren, 'without-children': !hasChildren(), 'current': isCurrent, 'open': isExpanded, 'closed': !isExpanded(), 'inactive': isInactive, 'ancestor': isAncestor}, attr: {'data-hj-test-id': testId}"><!-- ko ifnot: hasChildren --><!-- /ko --> <!-- ko if: hasChildren --> <a href="#" data-bind="click: click"> <i data-bind="css: css"></i> <!-- ko if: observableText() --> <span data-bind="text: observableText">Translations</span> <!-- /ko --> <!-- ko if: showDropDownCaret --> <i class="fa fa-caret-down icon-root-with-children"></i> <!-- /ko --> </a> <ul class="dropdown-content stacked stacked-tertiary"> <!-- ko if: !$data.parent && $data.hasChildrenWithChildren() --><!-- /ko --> <!-- ko if: isExpanded --><!-- /ko --> </ul> <!-- /ko --></li> I tried the following two ways but all failed. _IELinkClickByText($oIE, "Translations") or Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks Local $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, "Translations") Then _IEAction($oLink, "click") ExitLoop EndIf Next Link to comment Share on other sites More sharing options...
MonicaLu Posted May 7, 2019 Author Share Posted May 7, 2019 I add Sleep(3000) before upper code, then the _IELinkGetCollection() way works. I am curious why _IELinkClickByText() doesn't work. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted May 7, 2019 Share Posted May 7, 2019 @MonicaLu Could you share the link of the webpage? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
MonicaLu Posted May 7, 2019 Author Share Posted May 7, 2019 2 hours ago, FrancescoDiMuro said: @MonicaLu Could you share the link of the webpage? Hi FrancescoDiMuro Sorry I can not share the link of the webpage because it is an internal webpage which can only be accessed in our domain. I have got it work with the following code. Thanks anyway. Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks Local $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, "Translations") Then _IEAction($oLink, "click") ExitLoop EndIf Next 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