JeffO Posted December 15, 2020 Share 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted December 15, 2020 Developers Share 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. Link to comment Share on other sites More sharing options...
Danp2 Posted December 15, 2020 Share Posted December 15, 2020 Which browser? Show us what you've tried thus far. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
JeffO Posted December 16, 2020 Author Share 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 !! Link to comment Share on other sites More sharing options...
Danp2 Posted December 16, 2020 Share 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? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted December 16, 2020 Share 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) GreeNerO and SkysLastChance 2 “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...
JeffO Posted December 16, 2020 Author Share 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) 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