Jump to content

Recommended Posts

Posted (edited)

Hello,

I am trying to control the font uploading to a printer via a its web page.

5c5bf4686350b_printerwebpage.png.4a6dfbce61b34630e6904f1babf7a723.png

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.

5c5bf598ced66_AU3script.png.504d19a962d1ae2c366eb712c0d215d3.png

This shows the DOM explorer:

Lightbox-1.png.f60541ff6fb0662614c9638598fea712.png

<div id='lightbox' is clearly there.

When the script runs, I receive the following status message until I stop the script:

Status.png.3e3b94f9c045c46e71c74101f6e7459a.png

 

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 by norbert_u
Posted

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.

Posted

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:

AU_1.png.59910f466128cef4eba6f3211a7bd66f.png

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:

Status_1.png.b4ec3d7bed847ca4a2d6ea3117c23734.png

Because the '_IEObjByName' works ok I don't think that the $oIE object was lost.

Posted

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.

Posted (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:

before_screen.png.565b31e132405c8dc8886749453d1009.png

This is the Dom explorer before the 'Import' button is pressed:

beforeDOM.png.ac43027e65f031a0d9b4ae6d9d88ea6d.png 

'lightbox' is shown after 'import' button is pressed:

after_screen.png.3f81e17a542c3895a2f508b9dc2e6b9a.png

This is the DOM explorer after the 'import' button is pressed:

afterDOM.png.f801f86242b51f8841255e4a5da82599.png

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 by norbert_u
  • Moderators
Posted

@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!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...