1

I would like create test for the my website. I must click the button that open dialog and scrolling div. I have problem with "update DOM structure on the page". I don't see current DOM after click.

When I run the code, which click the button in Runtime.runScript/Runtime.evaluate in the structure DOM I don't see new elements. After run next Runtime.runScript/Runtime.evaluate the object Runtime has update DOM structure.

   Runtime.evaluate({expression: 'CLICK THE BUTTON'});
   Runtime.evaluate({expression: 'NEXT ACTION'});
   Runtime.evaluate({expression: 'NEXT ACTION'});
    /* .... */

Are there any solutions that have the current DOM structure all the time?

Runtime.evaluate({expression: 'CLICK THE BUTTON, SCROLLING, COMPLETE THE FORM...'});

I recently used phantomJS, but it's not efficient. I prefer nodejs.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
viko
  • 491
  • 6
  • 23
  • If one of the actions reloads the page you need to wait before accessing the new DOM. – wOxxOm May 30 '17 at 10:20
  • I thought about waiting. But setTimeout doesn't work in code that run. I added function that wait 10s and return object. Of Course `document.querySelector('.dialog-list')` is null. When I wait, I do screenshot. In the image I see dialog. – viko May 30 '17 at 10:32
  • I don't understand. When I used `setTimeout(..., 2000);` I saw `Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.` When I reset chromium this error is not there and setTimeout works. – viko May 30 '17 at 12:33

0 Answers0