Hey everybody!
Anyone can help me, I already tryed a lot of things and nothing
working here... I using Selenium RC, TestNG and JAVA in my tests.
I have the folow scenario:
1 - One method of login in my aplication using @BeforeTest anotation:
@BeforeTest()
public void login() {
selenium.open("the url goes here...");
selenium.type("username", "admin");
selenium.type("password", "admin");
selenium.type("captcha", "admin");
selenium.click("//input[@value='Login']");
selenium.waitForPageToLoad("3000");
}
2 - And a testcase wich use to do something in my system, but before
it need loged in my system, until here everything happens well, but
when I will confirmate the message of include data in my system the
Selenium can't find the button confirmation.
@Test(dataProvider = "MassaDeDados", dataProviderClass =
TemplateDataProvider.class)
public void InclusaoTipoDocumento (ArrayList<String> valor)
{
for (int i = 0; i < valor.size(); i++) {
selenium.click("link-0");
selenium.click("link-1");
selenium.waitForPageToLoad("3000");
selenium.click("//input[@value='Incluir']");
selenium.waitForPageToLoad("3000");
selenium.type("comptipoDocumentodscTipoDocumento", valor.get(i));
selenium.click("incluir_botao_salvar");
selenium.chooseOkOnNextConfirmation();
}
}
It's very strange because two reasons:
1 - In my application the erro happens like Selenium can't find the
button OK to confirmation, look the error exception:
FAILED: InclusaoTipoDocumento([nothingxzghawtqweqwwreq, maria9, joão9,
mixirica9, bahia9, Lorem9, ipsum9, dolor9, sit9, amet9, consectetur9,
adipiscing9, elit9, Curabitur9, odio9, orci9, imperdiet9, non9,
posuere9, vel9, eleifend9, ut9, magna9, Integer9, blandit9, iaculis9,
augue9, ])
Inclusao de Tipo de Documento
com.thoughtworks.selenium.SeleniumException: Timed out after 3000ms
at
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:
97)
at
com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:
91)
at
com.thoughtworks.selenium.DefaultSelenium.waitForPageToLoad(DefaultSelenium.java:
635)
at br.com.politec.testCases.CDU001.InclusaoTipoDocumento(CDU001.java:
45)
2 - But when I look the log file generate by Selenium-RC it's like
this:
* info(1284150721133): Appending missed logging messages
* info(1284150698036): Executing: |getTitle | | |
* info(1284150698050): Executing: |setContext |
d2e072fce7354f378d13be19615152db | |
* info(1284150698072): Executing: |windowMaximize | | |
* info(1284150698077): Executing: |windowFocus | | |
* info(1284150698088): Executing: |open | url goes here | |
* info(1284150698356): Executing: |type | username | admin |
* info(1284150698367): Executing: |type | password | admin |
* info(1284150698378): Executing: |type | captcha | admin |
* info(1284150698388): Executing: |click | //input[@value='Login']
| |
* info(1284150698458): Executing: |waitForPageToLoad | 3000 | |
* info(1284150699840): Executing: |click | link-0 | |
* info(1284150699881): Executing: |click | link-1 | |
* info(1284150699912): Executing: |waitForPageToLoad | 3000 | |
* info(1284150700259): Executing: |click | //
input[@value='Incluir'] | |
* info(1284150700285): Executing: |waitForPageToLoad | 3000 | |
* info(1284150700508): Executing: |type |
comptipoDocumentodscTipoDocumento | nothingxzghawtqweqwwreq |
* info(1284150700519): Executing: |click | incluir_botao_salvar |
|
* info(1284150700676): Executing: |chooseOkOnNextConfirmation | |
|
* info(1284150700682): Executing: |click | link-0 | |
* info(1284150700722): Executing: |click | link-1 | |
* info(1284150700756): Executing: |waitForPageToLoad | 3000 | |
* info(1284150703783): Executing: |captureEntirePageScreenshot | C:
\des\workspace\TestesAutomatizadosPolitec\Evidencias
\InclusaoTipoDocumento_2010-09-10_17-31-43.png | |
* info(1284150703904): Executing: |selectWindow | | |
* info(1284150703919): Executing: |open |
http://10.62.1.37:7080 |
|
* info(1284150721139): Done appending missed logging messages
* error(1284150721140): Log window displayed. Logging events will
now be recorded to this window.
Anyone can help me?? Thnks!