I tried applying this using ChatGPT, but it didn't work for me. Can you tell me where to put this code to make my code work?
// Функция для эмуляции нажатия мыши внутри элемента <canvas data-sentry-element="Stage"> function simulateMouseClickInCanvas() { const canvas = document.querySelector('canvas[data-sentry-element="Stage"]'); if (!canvas) { console.error("Элемент <canvas> не найден."); return; } const rect = canvas.getBoundingClientRect(); // Выбираем случайные координаты внутри элемента <canvas> const randomX = Math.random() * rect.width + rect.left; const randomY = Math.random() * rect.height + rect.top; // Создаём события мыши const mouseDownEvent = new MouseEvent("mousedown", { bubbles: true, cancelable: true, clientX: randomX, clientY: randomY, }); const mouseUpEvent = new MouseEvent("mouseup", { bubbles: true, cancelable: true, clientX: randomX, clientY: randomY, }); const clickEvent = new MouseEvent("click", { bubbles: true, cancelable: true, clientX: randomX, clientY: randomY, }); // Эмулируем события canvas.dispatchEvent(mouseDownEvent); canvas.dispatchEvent(mouseUpEvent); canvas.dispatchEvent(clickEvent); } // Функция для выполнения кликов с рандомной задержкой function performRandomClicksInCanvas(maxClicks) { let clicksCount = 0; function clickWithRandomDelay() { if (clicksCount >= maxClicks) { console.log("Все клики выполнены"); return; } const delay = Math.random() * (2000 - 100) + 100; // Рандомная задержка от 0.1 до 2 секунд setTimeout(() => { simulateMouseClickInCanvas(); clicksCount++; console.log(`Клик ${clicksCount} выполнен (задержка: ${Math.round(delay)} мс)`); clickWithRandomDelay(); // Рекурсивный вызов для следующего клика }, delay); } clickWithRandomDelay(); } // Запуск выполнения 10 кликов performRandomClicksInCanvas(10);Browser Automation Studio Turned White and does not work properly
-
I use browser automation studio in my rdp, but every time I close my rdp, when I open it back, my browser automation studio start misbehaving, everything turns white, no function works, I cant even run my bot while I'm not on my rdp, it hangs and doesn't work until I restart
Here is an example in the screenshot, I clicked create new resource, it's doesn't show even show up, and it shows white in the task bar, edit, I also ran as administrator, it doesn't work

-
@dimehook said in Browser Automation Studio Turned White and does not work properly:
I use browser automation studio in my rdp, but every time I close my rdp, when I open it back, my browser automation studio start misbehaving, everything turns white, no function works, I cant even run my bot while I'm not on my rdp, it hangs and doesn't work until I restart
Here is an example in the screenshot, I clicked create new resource, it's doesn't show even show up, and it shows white in the task bar
Run BAS as an administrator.
-
@dimehook
I can't reproduce your problem. Please answer a few questions.
What operating system is on the remote PC and what is on the main PC?
What version of BAS are you using?
Write a step by step algorithm to repeat the problem please. -
@m4zuper the problem is that, my bot can't run when I'm not on my rdp, it just stops, and the bot crashes somehow, if I try to run again, any pop up that's meant to show will just turn white as shown in the screenshot, it will only work when I restart the but.
I've tried on windows 10 and 11, my rdp is from Aws. -
@dimehook
Check if the server goes to sleep when you disconnect from it.
https://stackoverflow.com/questions/70794205/prevent-aws-ec2-instance-from-going-to-sleep-when-closing-terminal-window