-1

I tried a lot of different methods to set values for inputs https://www.instagram.com/accounts/login/?source=auth_switcher

  • username
  • password

    .waitForElementVisible('input[name=username]',1000)

But unfortunately I did not find a solutions

The only one wat I'm not really far from

.elements('name', 'username', function (elements) {
            elements.value.forEach(function (element) {
                browser.elementIdAttribute(element.ELEMENT, 'name', function (attribute) {
                    if (attribute.value === 'username') {
                        console.log('found username');
                    }
                });
            });
        })

But in this case I can not set value / tried element.setValue('xxx') which does not work.

Please help me

alytvynov
  • 81
  • 12

1 Answers1

0

For info, I found a solution

    var username = '';
    var password = '';

    browser
    .url('https://www.instagram.com/accounts/login/?source=auth_switcher')
    .waitForElementVisible('body', 5000)
    .pause(2000)
    .waitForElementVisible('input[name=username]', 5000)
    .waitForElementVisible('input[name=password]', 5000)
    .setValue('input[name=username]', username)
    .setValue('input[name=password]', password)
    .pause(2000)
alytvynov
  • 81
  • 12