0
respostas

Teste falha por causa de NoSuchElementException mesmo lançando ela

Olá, alguém poderia me ajudar? Pq meu teste falha por causa de Exception mesmo lançando ela?

ERRO

org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html

IMPORT

import org.openqa.selenium.NoSuchElementException;

TESTE

public void teste_de_cadastro_de_usuario_com_dados_validos() throws NoSuchElementException {

    AppiumDriver driverModulo = AppiumDriverConfig.Instance().driver;

    MobileElement botaoCadastro = (MobileElement) driverModulo.findElementById("br.com.alura.aluraesporte:id/login_botao_cadastrar_usuario");
    botaoCadastro.click();

    MobileElement campoNome = (MobileElement) driverModulo.findElementById("br.com.alura.aluraesporte:id/input_nome");
    MobileElement campoSenha = (MobileElement) driverModulo.findElementById("br.com.alura.aluraesporte:id/input_senha");
    MobileElement campoConfirmaSenha = (MobileElement) driverModulo.findElementById("br.com.alura.aluraesporte:id/input_confirmar_senha");

    campoNome.setValue("Marcel");
    campoSenha.setValue("123456");
    campoConfirmaSenha.setValue("123456");

    MobileElement botaoConfirmaCadastro = (MobileElement) driverModulo.findElementById("br.com.alura.aluraesporte:id/cadastro_usuario_botao_cadastrar");
    botaoConfirmaCadastro.click();

    MobileElement botaoLogar = (MobileElement) driverModulo.findElementById("br.com.alura.aluraesporte:id/login_botao_logar");
    //botaoLogar.click();

}

}