Struggling to find a solution for simulating a click on a button element on Outlook.com mobile website using JavaScript. Despite numerous attempts from online sources, the button remains unresponsive to clicks.
An interesting discovery was made that the click works when tapping with a finger or using Chrome devTools on a desktop.
Furthermore, it was observed that Selenium/Appium on a mobile device successfully triggers the click event.
Although efforts were made to locate the specific code responsible for this behavior on Selenium's GitHub repository, no luck so far. Any assistance in making the click function properly would be greatly appreciated.
Website:
Username: [email protected]
Password: natasha2018
Button - plus button located at the left corner https://ibb.co/h6eVFy
Tested Code:
1)
elem.click();
2)
function eventFire(el, etype){
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}
3)
$("#elem").click();
4)
var simulateClick = function (elem) {
// Create our event (with options)
var evt = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window
});
// If cancelled, don't dispatch our event
var canceled = !elem.dispatchEvent(evt);
};
Looking forward to any guidance on resolving this issue. Thank you.