Devegnik
Devegnik

Reputation: 195

Nightwatch. Click on element in first div with condition in second div

I have two div on my site: :

<div class="wg-block"  data-reactid="10"
  <div class="wg-header" data-reactid="11"/div>
    ....
     <h4 class='condition'>  "Text" </h4>
  <div class="wg-footer" data-reactid="12"/div>
    ....
      <div class="click"> </div>

I need to click on element in the second div, a condition which is on the first div.

How can I correct click on this element?

Upvotes: 1

Views: 1319

Answers (1)

Tyler H
Tyler H

Reputation: 470

You should be able to do this with a CSS selector.

browser.click('.wg-footer .click');

That selector would select all elements with class "click" that are inside the element with class "wg-footer".

The link below is a great resource for selecting elements with CSS. https://www.w3schools.com/cssref/css_selectors.asp

Upvotes: 1

Related Questions