A
A
Alexey2021-06-30 19:08:18
JavaScript
Alexey, 2021-06-30 19:08:18

Nighmare.js How to click on a non-unique class?

Good evening,

<!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Document</title>
    </head>
    <body>
      <div class="tabs">
        <div class="tabs__group">
          <div class="tabs__tab selected">
            <div class="tabs__text tabs__text--default">Все</div>
          </div>
          <div class="tabs__tab">
            <div class="tabs__text tabs__text--default">Завершенные</div>
          </div>
          <div class="tabs__tab">
            <div class="tabs__text tabs__text--default">Расписание</div>
          </div>
        </div>
      </div>
    </body>
    </html>


.click("tabs__tab") //Нужно кликнуть на 3 таб, где текст Расписание


Tell me, how in nighmare.js to click on a class in which there is no uniqueness at all, except for the text inside the tag? For example, 3 tabs?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2021-07-01
@Evelate

As soon as I wrote, I accidentally found the answer right away)
Just need to know better CSS Pseudo-class helped
naghtmare.click('.tabs__group div:nth-child(3)')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question