2

I am using cucumberjs selenium webdriver to take screenshot of web app that's developed with React.

My question would be: Given a nested list like below:

<ul>
  <li>child 1</li>
  <li>child 2</li>
</ul>
<ul>
  <li>child 3</li>
  <li>child 4</li>
  <li>
    <ul>
      <li>child 5</li>
      <li>child 6</li>
    </ul>
  </li>
</ul>

What would be a good approach to let selenium webdriver to know that this page has finished rendering(or updating), so that selenium webdriver can take a screenshot of fully rendered web page?

Some thoughts: 1. Extending React components to have extra data field that webdriver can know about (child) 2. Using the React lifecycle ComponentDidMount and ComponentDidUpdate

Some thoughts?

WABBIT0111
  • 2,233
  • 2
  • 18
  • 30
  • did you ever come up with a solution? – Bennett Dill Mar 01 '18 at 17:27
  • sort of. all the main stream front end framework/lib are in accordance to a common protocol. that is, you can check `document.readyState`=== "complete". that will tell you whether a page finish rendering. – WABBIT0111 Mar 22 '18 at 03:50

0 Answers0