-4

Good evening everyone, I have a problem in the playwright framework when I try to open a new tab in the firefox browser, it is connected with the fact that when I initialize the firefox browser after it has made certain conditions, it needs to open a new tab and start doing the same actions but with others data, but the bottom line is when my script processes the first action and I want to open a new tab in the SAME BROWSER, INSTEAD OF OPENING A NEW TAB, A NEW BROWSER firefox opens

page = context.new_page()

And also, the imitation of mouse scrolling using a java script does not work for me:

        page.evaluate('''

                            const scrollstep = 200; // Размер шага прокрутки (в пикселях)
                            const scrollInterval = 100; // Интервал между шагами (в миллисекундах)

                            const scrollHeight = document.documentElement.scrollHeight;
                            let currentPosition = 0;

                            const interval = setInterval(() => {

                                window.scrollBy(0, scrollstep);
                                currentPosition += scrollstep;

                                if (currentPosition >= scrollHeight) {

                                    clearInterval(interval);
                                } 
                            }, scrollInterval);


                    ''')

I tried to do the same actions on another chromium browser, but everything already works there, a new tab opens and not a new browser, but the problem is that chromium has very poor speed compared to firefox, I also read their official documentation: https://playwright.dev/docs/intro but I didn't find any useful information in it

Kumala3
  • 1
  • 2
  • "I have a joke in the dramaturgical framework" -- what does this mean? Is this a poor translation? Anyway, I'm not sure what you're asking, but a [mcve] would be great. Thanks. – ggorlen Aug 25 '23 at 20:10
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 25 '23 at 20:33

0 Answers0