0

I'm trying to use UISpec4J to test a file chooser. A button is supposed to make the file chooser pop up. I found an example for a file chooser that pops up from a menu option:

 WindowInterceptor
   .run(openMenu.triggerClick())
   .process(FileChooserHandler.init()
            .titleEquals("Select a template file")
            .assertAcceptsFilesOnly()
            .select("/home/bond/file.txt"))
   .run();

But I can't seem to get it to work with a simple button click instead - I know this is probably a really simple question but I can't seem to find other documentation to get this to work and I am pretty stuck... Can someone explain how to test this? Thanks!

CustardBun
  • 3,457
  • 8
  • 39
  • 65
  • What error is happeneing? This code looks ok. But my interceptors that use to work stopped once I move JDKs. Maybe this is something similar – Thomas Feb 06 '13 at 00:22

1 Answers1

0

I've also tried example from documentation and failed. Little change could help:

WindowInterceptor
        .init(openMenu.triggerClick())
        .process(FileChooserHandler.init()
            .titleEquals("Select a template file")
            .assertAcceptsFilesOnly()
            .select("/home/bond/file.txt"))
            .run();

I've replaced first instance of run to init. Probably, it's a typo in docs.