1

I try to get check an email on Gmail and delete this after it is clicked. For this I log in into gmail. Works well. I select the email. Works well. Email is open. But it seems that it is not possible to select the trash / delete icon. TestCafe Studio said it is item:

.click(Selector('.T-I.J-J5-Ji.nX.T-I-ax7.T-I-Js-Gs.mA[data-tooltip="Delete"]').find('div'))

or

.click(Selector('.T-I.J-J5-Ji.nX.T-I-ax7.T-I-Js-Gs.mA[data-tooltip="Delete"]').find('.asa'));

The element on the gmail website is:

<div class="T-I J-J5-Ji nX T-I-ax7 T-I-Js-Gs mA" act="10" role="button" tabindex="0" jslog="20283; u014N:cOuCgd,Kr2w4b" data-tooltip="Delete" aria-label="Delete" style="user-select: none;">
   <div class="asa">
      <div class="ar9 T-I-J3 J-J5-Ji"></div>
   </div>
</div>

It looks like that TestCafe cannot find any of this icon buttons no the page. Any experience with this and testcafe?

Complete Script:

test('Benutzer einladen', async t => {
    await t
        .useRole(bc3Tester)
        .navigateTo(inputStore.metaUrl)
        //Nach dem Login Start! Wir prüfen nun die Sprache.
        .expect(Selector('#cl-top-search').withAttribute('placeholder', 'Suchen...').exists).ok('Nicht deutsch. Sprache wechseln.')
        .wait(2000)
        .click(Selector('.cl-sidemenu-button'))
        .click(Selector('.side-menu-box.cl-asset-button-animation').nth(1).find('div').withText('Neuen Benutzer einladen'))
        .typeText(Selector('[class^=\"ReactModal__Content ReactModal__Content--after-ope\"]').find('.cl-input.cl-input-header').nth(0), 'testcafe.cliplister@gmail.com')
        .click(Selector('#react-select-4--value').find('div').withText('Wähle die Gruppe'))
        .click(Selector('#react-select-4--option-0'))
        .click(Selector('#react-select-5--value').find('div').withText('Rolle auswählen'))
        .click(Selector('#react-select-5--option-5'))
        .click(Selector('#keyword-tags').find('.preview-bottom-keyword'))
        .click(Selector('#react-select-4--value').find('div').withText('Wähle die Gruppe'))
        .click(Selector('#react-select-4--option-1'))
        .click(Selector('[class^=\"cl-button cl-button cl-button-animated dual-button\"]'))
        .wait(2000)
        .navigateTo('https://www.gmail.com')
        .typeText(Selector('#identifierId'), 'xxxx', {
            caretPos: 0
        })
        .click(Selector('.RveJvd.snByac'))
        .typeText(Selector('input').withAttribute('name', 'password'), 'xxx', {
            caretPos: 0
        })
        .click(Selector('#passwordNext').find('.RveJvd.snByac'))
        .click(Selector('span').withText('Invitation to join our Brand Channel').nth(1).nth(1).find('span'))
        .wait(2000)
//Testcafe will fail with this step
        .click(Selector('.T-I.J-J5-Ji.nX.T-I-ax7.T-I-Js-Gs.mA[data-tooltip="Delete"]').find('.asa'))
        .wait(2000);
});
Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
ingo
  • 776
  • 1
  • 10
  • 25
  • 1
    The provided selectors look correct. Could you please provide the full recorded script? – mlosev Aug 20 '19 at 09:53
  • I have added the script to the main question – ingo Aug 20 '19 at 09:58
  • I think it is a BUG inside Testcafe cannot read attributes with a "-" inside the name. – ingo Aug 21 '19 at 07:41
  • This is not TestCafe's bug - see [this github thread](https://github.com/DevExpress/testcafe/issues/4182). Please check this discussion to see how to correctly use the selector. – Artem Aug 22 '19 at 09:46

0 Answers0