I want to write a program to automate testing the web size for different screen sizes. I create window using QWebEngineView and I need to simulate user mouse to click and drag a drop elements in web page. I have tried qApp->sendEvent and qApp->postEvent but nothink work.
QMouseEvent *event1 = new QMouseEvent (QEvent::MouseButtonPress, point,
Qt::LeftButton,
Qt::LeftButton,
Qt::NoModifier);
qDebug() << qApp->sendEvent (driver, static_cast <QEvent *> ( event1 ) );
QMouseEvent *event2 = new QMouseEvent (QEvent::MouseButtonRelease, point,
Qt::LeftButton,
Qt::LeftButton,
Qt::NoModifier);
qDebug() << qApp->sendEvent (driver, static_cast <QEvent *> ( event2 ));
Both class return true but the event in the web page is not triggered. Need I to focus first the view? It has no parent and it's a window. No more graphical elements are used. Can you help me?
Ps: The javascript i don't want to use beacause: I can not focus a input using javascript simulated click, it has no coords to test a canvas for drag and drop.