Re: Taking screenshot of IE
You can use the java.awt.Robot class to get a screen shotof the desktop and process from there.
Re: Taking screenshot of IE
The main point is not taking screenshot, detecting where ie is placed.. However i have somehow solved the detecting ie part with searching for a color match however it is not the best answer of this problem..
Re: Taking screenshot of IE
Using the Robot class you can screen capture a given Rectangle. So if you can click the top left point of where you want the capture to be taken from and the bottom right point, then you can take those coordinates and build a Rectangle. Pass the Rectangle to Robot.createScreenCapture(Rectangle) and you will have a screen capture of all you want.
Hope this helps
Re: Taking screenshot of IE
However if we consider this operation will be done by an automation program things get worse :D
By the way i've solved problem temporarly with detecting the pixel colors of ie and seems it worked. However it is not stable for now :)
Anyway thanks...
Re: Taking screenshot of IE
Have you considered hard coding the co-ordinates? It's not the cleanest method, but then neither is comparing pixels. If it's on the same machine, then the position of the bars in IE shouldn't change, so you can hard code them in and then use the aforementioned method.
Re: Taking screenshot of IE
There must be windows commands to give you an applications window name and coordinates just search the windows help or docs. this would be much cleaner and reliable. You can then call em thru java and parse the input as per your need.
Re: Taking screenshot of IE
Quote:
Originally Posted by tbear
There must be windows commands to give you an applications window name and coordinates just search the windows help or docs. this would be much cleaner and reliable. You can then call em thru java and parse the input as per your need.
i tried to find those commands however i couldn't :(
Re: Taking screenshot of IE
Quote:
Originally Posted by Bnt
Have you considered hard coding the co-ordinates? It's not the cleanest method, but then neither is comparing pixels. If it's on the same machine, then the position of the bars in IE shouldn't change, so you can hard code them in and then use the aforementioned method.
Assume this system will test at least 10 hours, if there will be a 1 pixel movement at ie, whole test will fail, so think the thing that i'm trying to make is a emergency brake..
Re: Taking screenshot of IE
Quote:
Originally Posted by batuj
i tried to find those commands however i couldn't :(
There are definitely Windows API methods that will return this information - however, you would need to access them via JNI.
Don't tell people how to do things. Tell them what to do and let them surprise you with their results...
G. Patton