OnetapInc / chromy

Chromy is a library for operating headless chrome. 🍺🍺🍺
MIT License
605 stars 41 forks source link

Sending X and Y to mouse pressed #111

Open anton-kulagin opened 6 years ago

anton-kulagin commented 6 years ago

Could you help me with sending X and Y to mousePressed method. i want get it by rect and saved to variables or send in chain to next method(in my case mousePressed) How can i do it with predefine X and Y

        .wait(mousePressedSelector)
        .mousePressed(200,200)

How i want do it

var tempRect = {};
chromy
  .wait(mousePressedSelector)
  .rect(mousePressedSelector)
  .result(function(rect){
      tempRect =rect
   })
   .mousePressed(tempRect.left,tempRect.right)

And when it run mousePressed my chrome closed and looks like it do not apply.