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
Post a Comment