norbert_u Posted February 7, 2019 Posted February 7, 2019 (edited) Hello, I am trying to control the font uploading to a printer via a its web page. The 'Import a font' 'lightbox' is only shown after the 'Import'-button (which is a link) on the web page is pressed I have a simple AU3 script to check if the 'Import a font' lightbox has been loaded. This shows the DOM explorer: <div id='lightbox' is clearly there. When the script runs, I receive the following status message until I stop the script: I am at a loss why ‘_IEGetObjById’ cannot see the DIV id=“lightbox” even though DOM shows it as being there. Any idea what could cause this problem? simpleTest.au3 Edited February 14, 2019 by norbert_u
Subz Posted February 7, 2019 Posted February 7, 2019 Sometimes you'll lose the $oIE object, when clicking java links, have you tried reattaching to the window after clicking the link? PS: You shouldn't require While/Wend loop when using _IEGetObjById, as unusually an id should only be used once per page.
norbert_u Posted February 8, 2019 Author Posted February 8, 2019 Thank you for your reply Subz. I assume by 'reattaching' you mean to do another IECreate after the '_IELinkClickByIndex'? I've modified the script accordingly and also removed the while loop (I tried to use the while loop not for iterating through the Ids on the page but to wait until the element with the 'lightbox' Id becomes available). I have also added a '_IEGetObjByName'. Here is the modified code: When running this code, the Status shows that '_IEGetObjById' still gives an error, but '_IEGetObByName' seems to work ok as there is no error shown: Because the '_IEObjByName' works ok I don't think that the $oIE object was lost.
norbert_u Posted February 8, 2019 Author Posted February 8, 2019 (edited) I accidentally added another, but related, issue to this post. I have now removed that issue Edited February 13, 2019 by norbert_u
Danp2 Posted February 8, 2019 Posted February 8, 2019 I don't believe you are losing the IE object, but you would want to use _IEAttach instead of _IECreate in this situation. Have you checked to see if there are any frames involved with the lightbox? Latest Webdriver UDF Release Webdriver Wiki FAQs
Developers Jos Posted February 8, 2019 Developers Posted February 8, 2019 Let's stick to one thread to keep the whole story complete. 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.
norbert_u Posted February 11, 2019 Author Posted February 11, 2019 Thanks for your reply Danp2. 1) I've changed to '_IEAttach' instead of '_IECreate', 'lightbox' still can't be found. ;Click link to open font upload screen _IELinkClickByIndex($oIE,$Link_index,1) $oIE = _IEAttach("Font management") 2) The DOM explorer does not show any frame tags, there don't seem to be frames used.
norbert_u Posted February 11, 2019 Author Posted February 11, 2019 (edited) I have accidentally repeated the post. I have now removed that repeated post. Edited February 13, 2019 by norbert_u
norbert_u Posted February 11, 2019 Author Posted February 11, 2019 (edited) Hi, I've now used the functions '_IEDocReadHTML' and 'FileWrite' to save the HTML. The 'lightbox' can not be found in the saved HTML file, even though it exists in the DOM explorer. This is the screen before the 'Import' button is pressed: This is the Dom explorer before the 'Import' button is pressed: 'lightbox' is shown after 'import' button is pressed: This is the DOM explorer after the 'import' button is pressed: The lightbox is placed on top of the rest of the page, possibly using JavaScript. It seems that AutoIt cannot see this placed object. Is there any way I can make AutoIt see that lightbox? Edited February 14, 2019 by norbert_u
Moderators JLogan3o13 Posted February 11, 2019 Moderators Posted February 11, 2019 @norbert_u please wait 24 hours before bumping your thread. Posting a comment that is just a copy of what you said before is not going to get you an answer more quickly. This may be the most important thing in the world to you, but we have volunteers all across the world; the person best suited to help you may not be online right now. Please show some patience. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
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