Q:

how to use backspace in protractor

describe('backspace', function() {
    it('types some stuff and backspaces one character', function() {
        element(by.model('invoice.customerName')).sendKeys('Ali Khoda');

        element(by.model('invoice.customerName')).sendKeys(protractor.Key.BACK_SPACE);

        expect(element(by.model('invoice.customerName')).getText()).toBe('Ali Khod');

    });
});
0
describe('backspace', function() {
    it('types some stuff and backspaces one character', function() {
        element(by.model('invoice.customerName')).sendKeys('Ali Khoda').then(function() {

            element(by.model('invoice.customerName')).sendKeys(protractor.Key.BACK_SPACE).then(function() {

                expect(element(by.model('invoice.customerName')).getText()).toBe('Ali Khod');

            });

        });

    });
});
0

New to Communities?

Join the community