Questions tagged [playwright-python]

Microsoft Playwright is a web automation library comparable to Selenium. This tag refers to the Python port of the library.

Microsoft Playwright is a web automation library comparable to Selenium. Originally a Javascript project, this is now also available in Python.

Related tags:

365 questions
0
votes
0 answers

Can‘t generate allure-report from Jenkins with Docker

I'm trying to generate an Allure report for my cypress tests using jenkins + docker, current jenkins server is installed on mac. But I'm getting the following…
aquichita
  • 1
  • 1
0
votes
1 answer

Python Playwright pagelocator pass variable

I made a script that downloads zip-files from a website. The script needs to locate the correct link and download the file. I generated the script with codegen and it works, buth the filename is hardcoded. I would like the script to find the…
Tralala
  • 233
  • 2
  • 10
0
votes
1 answer

Infinite Scroll with Scrapy-Playwright not working

import scrapy from ..items import CentriItem from scrapy_playwright.page import PageMethod class NikespiderSpider(scrapy.Spider): name = 'nikespider' def start_requests(self): url =…
Emad
  • 1
0
votes
1 answer

Playwright Python: Get only selected attribute urls

import asyncio from playwright.async_api import Playwright, async_playwright, expect #Get images urls #Output: img_urls.csv (Consist of instances of {"property_id": str, "img_urls": []} async def run(playwright): image_urls = [] #Will contain…
Andrea
  • 328
  • 1
  • 3
  • 14
0
votes
0 answers

Getting duplicate Network Response Playwright Python

I have a working script but when I changed the page.on in playwright it actually runs the network response a certain number of times as per the loop count. I have been trying to figure out why that happens. For example at i=0 it gives one…
0
votes
0 answers

Playwright how to check between two elements which one is present

I'm using playwright to enter my email, navigate to a folder that automatically receives some emails every day. The body of the emails may contain a link to download a report or not, depending on whether there was production on that day. The program…
0
votes
1 answer

Playwright not loading all thumbnails on page

I'm using playwright with python. I have a pages with multiple thumbnails (>10), but everytime playwright is not detecting more than 8 with the css selector. Even though I manually checked and there are all the selectors available. Sample page…
NeonOni
  • 43
  • 5
0
votes
1 answer

Download files with goto in playwright-python

Is there a way to download a file by going straight to its download link with goto in playwright-python? async with page.expect_download(timeout=420000) as download_info: await…
Py Ton
  • 23
  • 1
  • 7
0
votes
2 answers

How to find partial text using Playwright

I'm using Playwright to write automated tests. My goal is to find an element by text contains and not by full match: myElement = self.page.locator('text="Some Text 123"') I wish to find only the elements with the text 123, how to do that?
Tal Angel
  • 1,301
  • 3
  • 29
  • 63
0
votes
1 answer

Python doesn't wait for checkbox

Good afternoon. When in test you go to the site page, the next step is to uncheck the checkbox. But as soon as the page loads, the playwrite tries to immediately click (uncheck) the checkbox. Tell me how to tell the playwright to wait a while for…
Valtesar
  • 41
  • 4
0
votes
1 answer

Exit an async with in Python

What I need is a way to get out of async with (line 2) if page.click (line 4) doesn't find the element, I tried with break but it didn't work, here's the code: try: async with page.expect_download(timeout=120000) as download_info: try: …
user19016544
0
votes
1 answer

Find first element above other element using Playwright

I have a div with text, for example 'abc'. I wish to find the first div above that element that has a class called 'myClass'. How to do it? My code doesn't work: self.page.locator(f'[class="myClass"] >> nth=0:' …
Tal Angel
  • 1,301
  • 3
  • 29
  • 63
0
votes
0 answers

Problems in Playwright when running a test within Microsoft login

Details: Currently I have a problem with Playwright. A test build of a website has a normal login with username and password. This login also works in the test, but after the login another query by Microsoft Login follows. The recorder of Playwright…
0
votes
1 answer

Waiting for a visible locator returns a non-clickable element

Together with my tech lead, we implemented this method: def get_visible_locator(self, selector): locators = self.page.query_selector_all(selector) for locator in locators: if locator.is_visible(): return…
Tal Angel
  • 1,301
  • 3
  • 29
  • 63