Click is not working on side menu using protractor


#1

I have this side menu and I can’t use the click to show his options…

<ion-nav-buttons side="left">
                <button class="button button-icon button-clear ion-navicon"
                        menu-toggle="left">
                </button>
            </ion-nav-buttons>

I tried:

element(by.css('.button.button-icon.button-clear.ion-navicon')).click();

But is not working… Can anyone help me?


#4

What is “protractor” here?
What is your second code example exactly?


#5

I am using appium + protractor + selenium to automate the tests and I have this menu from the first code example, but when I click on the second example command, nothing happens.


#6

Ah now I understood.

Is this how you “chain” classes in these selectors? I always forget…
Can you just give the button an id attribute and use that one?
Or use an xpath selector that your browser’s dev tools would give you for that button?
Is that button actually there in the generated and rendered output with these classes? Ionic does strange things sometimes.


#7

I can’t edit the app code.
Ionic is really strange sometimes.

I resolved the situation changing the locator to this:

element.all(by.className('button button-icon button-clear ion-navicon')).click();

But thanks for the suggestions! :smiley:


#8

Huh?

That’s what I meant by