sammy1983 Posted February 19, 2014 Share Posted February 19, 2014 Hi, Seeking help in Forum is amazing experience and once again, looking for someone to pull me out of this problem. I have an internal tool in my office which has below tabs as shown in the attachment. I am unable to navigate to "Manage Payees Tool" tab as the element has <a href = .............................................> Manage Payees Tool </a>. I know this can be accomplished using Send("{TAB 6}"), however, I think this should be the last option. Can anyone help? Link to comment Share on other sites More sharing options...
DicatoroftheUSA Posted February 19, 2014 Share Posted February 19, 2014 Have you tried "_ieclickbytext" or "_ieclickbyindex" as describe in the help file? Statism is violence, Taxation is theft. Autoit Wiki Link to comment Share on other sites More sharing options...
sammy1983 Posted February 19, 2014 Author Share Posted February 19, 2014 Have you tried "_ieclickbytext" or "_ieclickbyindex" as describe in the help file? Yes. I tried _IELinkClickByText with no success. I didnt try _IELinkClickByIndex as I need to find the index one by one entering in the code and running and checking if it's correct. Link to comment Share on other sites More sharing options...
sammy1983 Posted February 19, 2014 Author Share Posted February 19, 2014 Yes. I tried _IELinkClickByText with no success. I didnt try _IELinkClickByIndex as I need to find the index one by one entering in the code and running and checking if it's correct. Ok. so I tried _IELinkClickByIndex and I am able to click on the tab. This solves. My bad that I didn't try first. However, I still want to know if there is a possibility that we can directly click on the "Text" which is between <a href = some URL> Text </a> Link to comment Share on other sites More sharing options...
DW1 Posted February 19, 2014 Share Posted February 19, 2014 Ok. so I tried _IELinkClickByIndex and I am able to click on the tab. This solves. My bad that I didn't try first. However, I still want to know if there is a possibility that we can directly click on the "Text" which is between <a href = some URL> Text </a> That's what _IELinkClickByText() does. It clicks based on link.outerText in .document.links Odds are, you are not matching the text properly. Include any white-space perhaps? _IELinkClickByText($oIE, " Manage Payees Tool ") AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DicatoroftheUSA Posted February 19, 2014 Share Posted February 19, 2014 (edited) You can also check it with using the second example from the help file: #include <IE.au3> $oIE = _IE_Example ("basic") $oLinks = _IELinkGetCollection ($oIE) $iNumLinks = @extended MsgBox(0, "Link Info", $iNumLinks & " links found") For $oLink In $oLinks MsgBox(0, "Link Info", $oLink.href) Next and #include <IE.au3> $oIE = _IECreate("http://www.autoitscript.com") $sMyString = "wallpaper" $oLinks = _IELinkGetCollection($oIE) For $oLink in $oLinks $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") ExitLoop EndIf Next Edited February 19, 2014 by DicatoroftheUSA Statism is violence, Taxation is theft. Autoit Wiki Link to comment Share on other sites More sharing options...
sammy1983 Posted February 19, 2014 Author Share Posted February 19, 2014 You can also check it with using the second example from the help file: #include <IE.au3> $oIE = _IE_Example ("basic") $oLinks = _IELinkGetCollection ($oIE) $iNumLinks = @extended MsgBox(0, "Link Info", $iNumLinks & " links found") For $oLink In $oLinks MsgBox(0, "Link Info", $oLink.href) Next and #include <IE.au3> $oIE = _IECreate("http://www.autoitscript.com") $sMyString = "wallpaper" $oLinks = _IELinkGetCollection($oIE) For $oLink in $oLinks $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") ExitLoop EndIf Next Thanks a lot DW1 and DicatoroftheUSA for showing me right path. I have one another question, though not related to this post. Can I ask? Link to comment Share on other sites More sharing options...
DicatoroftheUSA Posted February 19, 2014 Share Posted February 19, 2014 Its better to create a new post, think about those who may have the same question as you in the future. Statism is violence, Taxation is theft. Autoit Wiki Link to comment Share on other sites More sharing options...
sammy1983 Posted February 19, 2014 Author Share Posted February 19, 2014 Its better to create a new post, think about those who may have the same question as you in the future. Fair point. Will start a new post. Thanks. 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