angularjs - Protractor : Find Element by ID with spaces -


i've got button following id

<button id="emp btn".... 

i'm unable access because of space

i've tried following , don't work

element(by.id("emp btn"));  element(by.id("emp%20btn"));  element(by.id("emp%btn"));  element(by.id('emp btn')); 

its bad idea use spaces in id. html 5 says, id must contain @ least 1 character , must not contain space characters.

but you still can find such element using xpath. try use this:

.\\button[contains(@id,'firstpart') , contains(@id,'secondpart')] 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -