JeffO 0 Posted December 15, 2020 (edited) Hi, Working on automating task on Microsoft Dynamics 365 site and it's a mess of nested iFrame. Not only are they nested like two or three level deep, but they don't have name ID, just some (hopefully static) http address. I'm no programmation wiz but I can work my way around anything, if I have examples to shamelessly copy from. Do you guys had to deal with loosely named nested iFrames like that ? Looking for a way to easily go through , selecting and attaching to the right one. If you have examples involving web dynamics, even better. Thanks, Jeff Edited December 15, 2020 by JeffO Better title Share this post Link to post Share on other sites
Jos 2,281 Posted December 15, 2020 Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states: Quote Share your cool AutoIt scripts, UDFs and applications with others. Do not post general support questions here, instead use the AutoIt Help and Support forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
Danp2 948 Posted December 15, 2020 Which browser? Show us what you've tried thus far. [UDF] WebDriver Latest version Wiki FAQs Share this post Link to post Share on other sites
JeffO 0 Posted December 16, 2020 (edited) Hi Danp2, Edit : Browser is Chrome Well, it's complicated... I thought webdriver was defective so I involved a DEV friend who analysed the problem with me. Thing is, he's a python guy and we successfully tackle the problem in this language. Mainly because with the help of VisualStudio debugger we were able to see how the iFrame were nested and indexed. I assume object manipulation is similar, give or take some commas and quotes. (I leave out the standard library loading, the authentication which is really simple) So here how I successfully instantiated the inbedded iFrame page = page.mainFrame.childFrames[0].page.frames[2] This will most likely fail sooner than later because the iFrame nesting is unstable and if someone sneeze by the browser it might work anymore. So, what I need to do is find a way to list all the iFrame (back on auto-it, I don't master python) on a page down to the last nested one, find the right one by either name or other criteria and attach to it. Many thanks, Jeff Edited December 16, 2020 by JeffO Forgot a tiny important piece of information, the browser !! Share this post Link to post Share on other sites
Danp2 948 Posted December 16, 2020 Can you tell us more about your usage of Dynamics 365? Is it for a particular product version? Can you provide access to this system or is there a demo available that we can access? [UDF] WebDriver Latest version Wiki FAQs Share this post Link to post Share on other sites
Nine 1,108 Posted December 16, 2020 Would that be helpful to you ? ConsoleWrite("Frames=" & _WD_GetFrameCount($sSession) & @CRLF) Local $aTag = _WD_FindElement($sSession, $_WD_LOCATOR_ByTagName, "iFrame", Default, True) _ArrayColInsert($aTag, 1) _ArrayColInsert($aTag, 1) For $i = 0 To UBound($aTag)-1 $aTag[$i][1] = _WD_ElementAction($sSession, $aTag[$i][0], "attribute", "name") $aTag[$i][2] = _WD_ElementAction($sSession, $aTag[$i][0], "attribute", "id") Next _ArrayDisplay($aTag) Not much of a signature but working on it... Spoiler Block all input without UAC Save/Retrieve Images to/from Text Tool to search content in au3 files Date Range Picker Sudoku Game 2020 Overlapped Named Pipe IPC x64 Bitwise Operations Multi-keyboards HotKeySet Fast and simple WCD IPC Multiple Folders Selector GIF Animation (cached) Share this post Link to post Share on other sites
JeffO 0 Posted December 16, 2020 Nine-Neuf, Looks promising ! I will try it tonite, I'll keep you posted. 1 hour ago, Nine said: Would that be helpful to you ? ConsoleWrite("Frames=" & _WD_GetFrameCount($sSession) & @CRLF) Local $aTag = _WD_FindElement($sSession, $_WD_LOCATOR_ByTagName, "iFrame", Default, True) _ArrayColInsert($aTag, 1) _ArrayColInsert($aTag, 1) For $i = 0 To UBound($aTag)-1 $aTag[$i][1] = _WD_ElementAction($sSession, $aTag[$i][0], "attribute", "name") $aTag[$i][2] = _WD_ElementAction($sSession, $aTag[$i][0], "attribute", "id") Next _ArrayDisplay($aTag) Share this post Link to post Share on other sites