2

I need to write an automated test (Protractor) for a chart. I proceeded as follows:

  1. Created an xpath that grabbed an array of HTML elements representing data points on the graph.
  2. Used elements.all(by.xpath...).then(...
  3. Inside 'then' created an array of promises via .getOuterHtml... Inside the same 'then' used q.all(...) to convert the array of new promises to the resolved array of Strings. Passed this array to a method that extracted x/y positions from outerHtml and returned them as an array of objects, each object having .x and .y properties.
  4. Confirmed that .x/.y properties of each object contain numbers and tries to run jasmine's expect(...) on each .y property ( I had expected values hard-coded)
  5. So... I am within outer "then" within Q.all().then(....). A call to jasmine's expect threw a null pointer error... An attempt to manually compare the values via if/else --> console.log threw [0211/144122:ERROR:gles2_cmd_decoder.cc(9368)] Context lost because PostSubBuffe r failed. [0211/144122:ERROR:gles2_cmd_decoder.cc(4638)] Error: 5 for Command kPostSubBuff erCHROMIUM
  6. Any idea what is going on? Thanks.
showdev
  • 28,454
  • 37
  • 55
  • 73
  • Could you please make the example more specific by providing what code you have so far and point where the problem is? Thank you. – alecxe Feb 11 '16 at 21:19
  • And, btw, `q` is not completely safe to use instead of the webdriverjs/protractor promises: https://github.com/angular/protractor/issues/2412#issuecomment-129035147 and http://stackoverflow.com/questions/31887795/spreading-promises-in-protractor. – alecxe Feb 11 '16 at 21:20

0 Answers0