I have a question, my uitest does not select the "Sugestões" option inside the picker.

    void SolicitacaoDeAtendimentoAndroid()
    {
        EntrarNoSistemaModoDev();

        app.WaitForElement(x => x.Marked("BankingPage_SolicitarAtencimentoBtn"));
        app.Screenshot("Escolhe a opcão Solicitação de Atendimento");
        app.Tap(x => x.Marked("BankingPage_SolicitarAtencimentoBtn"));

        app.WaitForElement(x => x.Marked("Cbo_MotivoDoContato"));
        app.Screenshot("Escolhe o Motivo do contato.");
        app.Tap(x => x.Marked("Cbo_MotivoDoContato"));

        //This part of the code does not select the "Sugestões" option, scrolling inside the Picker occurs, but the scroll does not stop, with a timeout error.
        app.ScrollDownTo(x => x.Text("Sugestões"),
                         x => x.Class("NumberPicker").Index(0),
                         ScrollStrategy.Auto,
                         timeout: TimeSpan.FromMinutes(1));
        app.Tap(x => x.Marked("button1"));

        app.WaitForElement(x => x.Marked("Cbo_Detalhamento"));
        app.Tap(x => x.Marked("Cbo_Detalhamento"));

     }

Answers

  • MatthewRegulMatthewRegul USXamarin Team Xamurai
    edited March 2017

    Just after your app.ScrollDownTo(), try adding a Tap for "Sugestões". I believe it is being told to scroll down to the right option, but not actually select it.

    If adding the tap doesn't work, can you please post a sample of your UI's code, so I can mock up my own version?

    app.ScrollDownTo(x => x.Text("Sugestões"),
        x => x.Class("NumberPicker").Index(0),
        ScrollStrategy.Auto,
        timeout: TimeSpan.FromMinutes(1));
    
    app.Tap(x => x.Marked("Sugestões"));    // Try adding this  <-----------
    
    app.Tap(x => x.Marked("button1"));
    
    
  • MatthewRegulMatthewRegul USXamarin Team Xamurai

    @CarlosSilva.1405, any luck?

Sign In or Register to comment.