Forum Xamarin Test Cloud (Read Only)

How to access the the icon in toolbar header

Hi,

I am trying to access the More Options icon (three vertical dots) in toolbar header in a test method. This icon doesn't have any id associated with it neither it has any visible labels. I found the "More Options" label via repl and tried to access using that label. But it isn't working. Getting timeout exception on the WaitForElement method. Am on a native project not forms. Any idea on how to access it ?

Thanks
Kumaran

Tagged:

Best Answer

  • Accepted Answer

    Hi Shantimohan,

    Found the solution. Below code works. I tried it earlier but the O in options was in caps.

    app.Tap(c => c.Marked("More options"));

    Thanks for your time.

    Kumaran

Answers

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    Just use the 'label'.

  • Hi Shantimohan,

    What do you mean by label here. Are you asking me to try finding it using the label (More Options). I tried the below and it threw a timeout exception
    app.WaitForElement(c=>c.All("More Options"));

    Thanks
    Kumaran

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    @kumaran52v said:
    Hi Shantimohan,

    What do you mean by label here. Are you asking me to try finding it using the label (More Options). I tried the below and it threw a timeout exception
    app.WaitForElement(c=>c.All("More Options"));

    Thanks
    Kumaran

    Just to understand it better, can you show the XAML for setting ToolbarItems? How are you getting that "More Options" button?

  • Hi,

    It isn't a Xamarin Forms app. It is Xamarin Android native app. It is coming out of the box. Default xamarin native project template gives it. I think, it is part of android.support.v7.widget.Toolbar control. Because I don't see the "More Options" label in the toolbar.axml file.

  • KumaranVellaisamy.1744KumaranVellaisamy.1744 INMember ✭✭
    Accepted Answer

    Hi Shantimohan,

    Found the solution. Below code works. I tried it earlier but the O in options was in caps.

    app.Tap(c => c.Marked("More options"));

    Thanks for your time.

    Kumaran

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    @kumaran52v said:
    Hi Shantimohan,

    Found the solution. Below code works. I tried it earlier but the O in options was in caps.

    app.Tap(c => c.Marked("More options"));

    Thanks for your time.

    Kumaran

    That's great.

Sign In or Register to comment.