|
|
Re: Using SWTBot to wait for a dialog to display [message #7552 is a reply to message #6184] |
Mon, 08 December 2008 17:58 |
Joe Luebker Messages: 36 Registered: July 2009 |
Member |
|
|
Ketan Patel wrote:
> I am using version 2.0 and it has following method to wait for shell:
>
> /**
> * @return a wrapper around a @{link Shell} with the specified text.
> * @param text the text on the shell.
> */
> public SWTBotShell shell(String text) {
> return shell(text, 0);
> }
>
> /**
> * @return a wrapper around a {@link Shell} with the specified index.
> * @param text the text on the shell.
> * @param index the index of the shell, in case there are multiple shells
> with the same text.
> */
> public SWTBotShell shell(String text, int index) {
> WaitForShell waitForShell = waitForShell(withText(text));
> waitUntilWidgetAppears(waitForShell);
> return waitForShell.get(index);
> }
>
Thanks, I will try to use the SWTBotFactory.shell() method.
BTW, there is a difference in the APIs that you referenced versus what I
am using. I guess a difference in version 2.0 vs. version 2.0.0.1164?
I am using the latter and have the following APIs
/**
* @return a wrapper around a @{link Shell} with the specified text.
* @param text the text on the shell.
*/
public SWTBotShell shell(String text) {
return shell(text, 0);
}
/**
* @return a wrapper around a {@link Shell} with the specified index.
* @param text the text on the shell.
* @param index the index of the shell, in case there are multiple
shells with the same text.
*/
public SWTBotShell shell(String text, int index) {
return new SWTBotShell(shells(text).get(index));
}
/**
* @return a wrapper around a {@link Shell} with the specified index.
* @param text the text on the shell.
*/
public List<Shell> shells(String text) {
WaitForShell waitForShell = waitForShell(withText(text));
waitUntilWidgetAppears(waitForShell);
ArrayList<Shell> allShells = waitForShell.getAllShells();
return allShells;
}
Thanks,
Joe
|
|
|
|
Powered by
FUDForum. Page generated in 1.03543 seconds