Menu

#32 TimeException on FileDownloadDialog

open
nobody
None
5
2009-05-05
2009-05-05
Chan Ray
No

Hello everybody,
I've been working with Watij for the last few days and it works great.
The only problem I met is the following :
When I tried to have a pointer on a file dowload dialog box, I catch a TimeoutException.
The code is as simple as : FileDownloadDialog fileDialog = ie.fileDownloadDialog();

I reproduce the same behaviour on the page : http://mirror.mkhelif.fr/apache/ant/ clicking on the 'ant-current-bin.zip' link.
Here's the code to reproduce :

watij.runtime.ie.IE ie = new watij.runtime.ie.IE();
ie.start("http://mirror.mkhelif.fr/apache/ant/");
Links links = ie.links();
Iterator<Link> linksIt = links.iterator();
while(linksIt.hasNext()){
Link link = linksIt.next();
if(link.text().indexOf("ant-current-bin.zip") >=0){
link.click();
FileDownloadDialog fileUd = ie.fileDownloadDialog();
logger.info("OK");
logger.info(""+fileUd.title());
}
}

I never get the 'OK' message. And always have the timeout exception.
Also have the non blocking (non blocking because it does not stop the program and is not really the problem) :
java.lang.IllegalArgumentException: Value 200 does not belong to specified com.jniwrapper.win32.ie.event.StatusCode enumeration

Now, I thought to myself, perhaps the Timeout occurs before the dialog box arrives on the screen.
So I've written the code like this (just to make sure) :

FileDownloadDialog fileDialog = null;
while(true){
try{
fileDialog = ie.fileDownloadDialog();
break;
}catch(watij.time.TimeException e){
e.printStackTrace();
logger.info("IGNORE ");
}
}
In this case, I keep having (undefinitely) the ("IGNORE ") message above and the Exception : watij.time.TimeException

Any ideas ?

Regards,

Discussion


Log in to post a comment.

Auth0 Logo