Caria Posted April 10, 2019 Share Posted April 10, 2019 I have an internal website: <html> <head>...</head> <body> <div class="" id="wrapper"> <div class="contIframe noLnb"> <iframe name="contentIframe" id="contentIframe" src="/wl/com/shared/getPortal.do"> <html> <head>...</head> <frameset name="tqmSet" id="tqmSet"> <frame name="tqmFrame" id="tqmFrame"> <html> <head>...</head> <body> <form name="LeftMenuProjectForm" id="LeftMenuProjectForm"> <div class="bgLightGray paddR0"> <div class="blueTreeH" id="menu_1"> <span class="arrow"> <a onclick="changeTop('default')" href="javascript:void(0)">ABC</a> </span> ................................. I can getElementById the contentIframe, but cannot getElement into it. Now I want to click to ABC, please help me! Link to comment Share on other sites More sharing options...
Juvigy Posted April 10, 2019 Share Posted April 10, 2019 First use _IEFrameGetCollection to get the frame and them _IELinkGetCollection to get the link and click on it with _IEAction Link to comment Share on other sites More sharing options...
Caria Posted April 10, 2019 Author Share Posted April 10, 2019 1 hour ago, Juvigy said: First use _IEFrameGetCollection to get the frame and them _IELinkGetCollection to get the link and click on it with _IEAction Hi Juvigy, thank you for you support! But when I try it $obj5 = _IEFrameGetCollection($web) $numFrame = @extended MsgBox(0,"","Frames found: " &$numFrame) For $i=0 To $numFrame-1 $obj6 = _IEFrameGetCollection($web, $i) $obj7 = _IELinkGetCollection($obj6) $numLink = @extended MsgBox(0,"","Frame " &$i &" found " &$numLink &" links") For $j=0 To $numLink-1 MsgBox(0,"","i=" &$i &", j=" &$j &", link: " &$obj7.href) Next Next the result is: Quote Frames found: 9 Frame 0 found 0 links Frame 1 found 0 links Frame 2 found 0 links Frame 3 found 0 links Frame 4 found 0 links Frame 5 found 0 links Frame 6 found 0 links Frame 7 found 0 links Frame 8 found 0 links it cannot found any link in frames! Link to comment Share on other sites More sharing options...
Nine Posted April 10, 2019 Share Posted April 10, 2019 Maybe you could try something like this : Local $oFrm1 = _IEFrameGetObjByName ($web,"contentIframe") Local $oFrm2 = _IEFrameGetObjByName ($oFrm1,"tqmFrame") Local $colA = _IETagNameGetCollection ($oFrm2,"a") For $a in $colA if $a.innerText = "ABC" then $a.click () ExitLoop endif Next Caria 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
junkew Posted April 10, 2019 Share Posted April 10, 2019 Maybe you have nested frames so more then the 9 of the main page. Whats developer tool showing for the hierarchy FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Caria Posted April 11, 2019 Author Share Posted April 11, 2019 14 hours ago, Nine said: Maybe you could try something like this : Local $oFrm1 = _IEFrameGetObjByName ($web,"contentIframe") Local $oFrm2 = _IEFrameGetObjByName ($oFrm1,"tqmFrame") Local $colA = _IETagNameGetCollection ($oFrm2,"a") For $a in $colA if $a.innerText = "ABC" then $a.click () ExitLoop endif Next Many thanks to you! It's work! 😂 Thank you very much! ^^ Link to comment Share on other sites More sharing options...
Caria Posted April 11, 2019 Author Share Posted April 11, 2019 13 hours ago, junkew said: Maybe you have nested frames so more then the 9 of the main page. Whats developer tool showing for the hierarchy I'm a DOM AutoIT newbie, so many things I've never met before. Thanks for your support! Link to comment Share on other sites More sharing options...
Caria Posted April 12, 2019 Author Share Posted April 12, 2019 (edited) Hi everybody. I have a trouble. When I click an element, it open a new IE Window named "XYZ". I can use _IEAttach to attach it into an object by the title, and hide it (with _IEAction invisible). But the time from I clicked to element to the time new Window loaded title (to hide it) , it's shown a blank window, and I don't like this. How can I hide it completely and nothing (new blank window not appeared). Thank you! Edited April 12, 2019 by Caria Link to comment Share on other sites More sharing options...
Juvigy Posted April 15, 2019 Share Posted April 15, 2019 Hi Caria, When you manually click it - is it behaving the same? One way to do this is to hid the entire IE as an application before clicking and show the first instance only after you have attached to the new window that will remain hidden. Link to comment Share on other sites More sharing options...
Caria Posted April 16, 2019 Author Share Posted April 16, 2019 16 hours ago, Juvigy said: Hi Caria, When you manually click it - is it behaving the same? One way to do this is to hid the entire IE as an application before clicking and show the first instance only after you have attached to the new window that will remain hidden. Hi Juvigy, I understand what you mean: Hide all IE window, and click (and bla bla bla), and show back all IE window... But when user is using IE, it's not really good. Link to comment Share on other sites More sharing options...
Juvigy Posted April 24, 2019 Share Posted April 24, 2019 It depends how you started IE or attached to it, but you can start a separate instance of IE, then hide only that instance and leave whatever the user has intact. Link to comment Share on other sites More sharing options...
junkew Posted April 24, 2019 Share Posted April 24, 2019 Whats the issue with a white window? You could draw a picture in it or make it black.🤔 what kind of solution do you expect as i assume same would happen when a user clicks. You could resize, hide, move window away but for me unclear what your requirement is. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets 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