Jump to content
Sign in to follow this  
bailworth

Identifying a window

Recommended Posts

bailworth

Dear All,

This is my first post in this forum so I hope somebody out there can help me.

I am developing my first autoit project and so far have managed to find all the answers to my questions somewhere in the forum. However, I cannot seem to find anything that helps me with the issue I currently have, which is:

I am developing an autoit project to work with a IE based application that reads/writes data to an oracle database. The application uses java and so when I use the 'Window Info' tool, the 'text' that is found in the window just says 'Output Painter Window'. This is causing me a problem because there is a parent application window and several child application windows within the same IE browser window (I hope that makes sense).

Part of the process that my project does, is to enter a bank sortcode and account number. However, when I click 'Next' the application checks to see if the sortcode and account number already exists in the oracle database and opens different windows as to whether it does or does not already exist. What I would like to do is find a way to identify if this window appears and if so then I will change the next process in the autoit project, if it doesnt appear then continue with the predefined function. The problem is, that I cannot uniquely identify this child window that opens because the 'Window Info' tool doesnt find any text that is specifc to this page, it just lists 'Output Painter Window' the same as all the others.

Does anyone know of another way that I can identify this window or a clever work around to help me with this?

Thanks in advance

Keith

Share this post


Link to post
Share on other sites
PsaltyDS

Dear All,

This is my first post in this forum so I hope somebody out there can help me.

I am developing my first autoit project and so far have managed to find all the answers to my questions somewhere in the forum. However, I cannot seem to find anything that helps me with the issue I currently have, which is:

I am developing an autoit project to work with a IE based application that reads/writes data to an oracle database. The application uses java and so when I use the 'Window Info' tool, the 'text' that is found in the window just says 'Output Painter Window'. This is causing me a problem because there is a parent application window and several child application windows within the same IE browser window (I hope that makes sense).

Part of the process that my project does, is to enter a bank sortcode and account number. However, when I click 'Next' the application checks to see if the sortcode and account number already exists in the oracle database and opens different windows as to whether it does or does not already exist. What I would like to do is find a way to identify if this window appears and if so then I will change the next process in the autoit project, if it doesnt appear then continue with the predefined function. The problem is, that I cannot uniquely identify this child window that opens because the 'Window Info' tool doesnt find any text that is specifc to this page, it just lists 'Output Painter Window' the same as all the others.

Does anyone know of another way that I can identify this window or a clever work around to help me with this?

Thanks in advance

Keith

Have you examined the IE DOM objects involved with something like DebugBar, and looked at the _IE* functions of the IE.au3 UDF?

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
bailworth

Have you examined the IE DOM objects involved with something like DebugBar, and looked at the _IE* functions of the IE.au3 UDF?

:D

No I havent and I dont profess to know much about DOM, is there any pointers you could give me?

Share this post


Link to post
Share on other sites
PsaltyDS

No I havent and I dont profess to know much about DOM, is there any pointers you could give me?

Try out the example scripts for the various _IE* functions in the help file to get the general idea. The specifics can be Googled, for example:

MSDN: About the W3C Document Object Model

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
bailworth

Try out the example scripts for the various _IE* functions in the help file to get the general idea. The specifics can be Googled, for example:

MSDN: About the W3C Document Object Model

:D

Thanks for the reference. However, I have got stuck on a starter for 10.

I am trying to read in the html of the particular page (mentioned above) so that I can flag an identification process on it as a possible resolution, but I cant see how to _IEDocReadHtml on a window that is already open. I can get the html using _IECreate but this is no good as the window will already be open. I tried _IEAttach but that didnt seem to work.

Share this post


Link to post
Share on other sites
PsaltyDS

Thanks for the reference. However, I have got stuck on a starter for 10.

I am trying to read in the html of the particular page (mentioned above) so that I can flag an identification process on it as a possible resolution, but I cant see how to _IEDocReadHtml on a window that is already open. I can get the html using _IECreate but this is no good as the window will already be open. I tried _IEAttach but that didnt seem to work.

Take it one step at time. First, you need to get _IEAttach() working. Post your code for just getting "$oIE = _IEAttach(your, stuff, here)".

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
bailworth

Take it one step at time. First, you need to get _IEAttach() working. Post your code for just getting "$oIE = _IEAttach(your, stuff, here)".

:D

The window that I want to read the html from is a remote login. When I run the 'Window Info' tool it returns the IP address, this works fine for using something like 'WinActivate("00.11.22.33") but _IEAttach doesnt seem to like it. Here the 3 lines of code I am using

$oIE = _IEAttach("00.11.22.33")

$sHTML = _IEDocReadHTML($oIE)

MsgBox(0, "Document Source", $sHTML)

Edited by bailworth

Share this post


Link to post
Share on other sites
PsaltyDS

The window that I want to read the html from is a remote login. When I run the 'Window Info' tool it returns the IP address, this works fine for using something like 'WinActivate("00.11.22.33") but _IEAttach doesnt seem to like it. Here the 3 lines of code I am using

$oIE = _IEAttach("00.11.22.33")

$sHTML = _IEDocReadHTML($oIE)

MsgBox(0, "Document Source", $sHTML)

Look at the second parameter in the help file for _IEAttach(). The default match type is "Title", the DOCUMENT title. You seem to want "WindowTitle".

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
bailworth

Look at the second parameter in the help file for _IEAttach(). The default match type is "Title", the DOCUMENT title. You seem to want "WindowTitle".

:D

I is beng well DUM ere, how do I specify the window title instead of the document title?

I have tried _IEAttach("00.11.22.33","embedded") but that just returns 0

Share this post


Link to post
Share on other sites
PsaltyDS

I is beng well DUM ere, how do I specify the window title instead of the document title?

I have tried _IEAttach("00.11.22.33","embedded") but that just returns 0

If it is a standard instance of IE, then _IEAttach("00.11.22.33","WindowTitle") should work.

Why did you try "embedded"? Is this instance of IE embedded within another app's GUI?

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
bailworth

If it is a standard instance of IE, then _IEAttach("00.11.22.33","WindowTitle") should work.

Why did you try "embedded"? Is this instance of IE embedded within another app's GUI?

:D

Thanks for the syntax, I will give it a try and see what happens. I have no idea why I tried 'embedded', other than the fact that I had been trawling through the help files, reading so much material that I think I just got totally confused. I only started on autoit a few days ago so am still a total newbie.

Thanks for your help so far, I will give your suggestion a try and see what happens.

Edited by bailworth

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.