1- when the (next) button appears, click it and then click on (finish).
A: By the way you didn’t put a waiting team after the click of the next button, put a team on the button after it clicks forward, make the system wait a little longer and then click on finish.
2-Only that depends, for the fact that it has some plates that do not need to press the button (forward) but only on the button (finish). So in this case you have to create a function in your project that identifies which enrolls the (next) button can be clicked.
Example enrollment 12345677 this enrollment does not need to have the button (forward) just finish, so you will make this code
IwebElement BtAvancar = Driver.GetElement(By.Id("IdBtnAvanar");
IwebElement BtConcluir = Driver.GetElement(By.Id("IdBtnConcluir);
public void AcaoBtn()
{
//Inserindo a mátricula que não precisa clicar no botão de avançar
IwebElement CampoMatricula = Driver.GetElement(By.Id("CampoNumMatriula"));
CampoMatricula.SendKeys("12345677");
//Time de Espera
System.Thrading.thread.sleep(2000);
//Verifico se na minha página tem o botao de avançar
if(driver.PageSource.Contains("Avançar"))
{
//Crie uma função que ignore o botão
}
if(driver.PageSorce.Contains("Concluir")
{
BtConcluir.Click();
}
}
For now that’s just a simple answer, because I don’t know what the page code looks like,
if you can put the page code just to know how this writing will be easier to help and understand your problem!