You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opened the browser
navigated to page
filled the details on page and clicked on export button
Actual : some random id is visible on screen but not able to open it .The file is saved no where
expected: correct file name should get downloaded.also on page the correct file names appears near download icon of page
Expected behavior
expected: correct file name should get downloaded.also on page the correct file names appears near download icon of page
Actual behavior
Actual : some random id is visible on screen but not able to open it .The file is saved no where
Additional context
this is how i am launching the browser def create_browser(self):
"""
Creates a browser instance for Chrome using Playwright.
"""
try:
self.browser = self.playwright.chromium.launch(
channel= 'chrome',
headless = False,
slow_mo = 1000,
args = self.get_browser_args()
)
except Exception as exception:
raise Exception(f'Unable to launch Chrome browser for testing. Exception noted: {exception}')
return self.browser
def get_browser_args(self):
"""
Returns all the required arguments for launching the browser.
"""
args = [
"--test-type",
"--disable-extensions",
"--proxy-server='direct://'",
"--proxy-bypass-list=*",
'--ignore-certificate-errors',
"--no-sandbox",
"--disable-dev-shm-usage",
"--disable-browser-side-navigation",
"--disable-web-security",
"--disable-infobars",
"--disable-popup-blocking",
"--disable-features=VizDisplayCompositor",
"--disable-gpu",
"--disable-setuid-sandbox",
"--disable-software-rasterizer",
"--start-maximized",
'--disable-blink-features=AutomationControlled',
'--disable-features=IsolateOrigins,site-per-process',
'--disable-site-isolation-trials'
]
also for download using this code def download_file(self, timeout_seconds):
"""
Waits for a download to complete within the specified timeout.
:param timeout_seconds: Maximum time to wait for the download to complete.
:return: The download object or None if download fails.
"""
try:
# Wait for the download event
download = self._page.wait_for_event('download', timeout=timeout_seconds * 1000)
return download
except PlaywrightTimeoutError:
# Handle timeout exceptions when the download does not occur within the expected time
assert_verify.verify_fail(f"Download did not complete within {timeout_seconds} seconds.")
return None
def file_download_implementation():
if dimension_type is not None and file_extension is not None:
self.get_element('Common_Report_Btn', *[dimension_type, dimension_type]).click_element()
elif dimension_type is None and link is not None:
self.get_element('Common_link', link).click_element()
else:
file_extension=dimension_type
self.get_element('Export_Btn').click_element()
# Wait for the download to complete
filedownload_waiting_time = ExecutionManager.filedownload_waiting_time
download = self.download_file(timeout_seconds=filedownload_waiting_time)
if download:
# Get the suggested filename and save it to the custom folder
last_modified_file_name = download.suggested_filename
download_path = os.path.join(folder_path, last_modified_file_name)
download.save_as(download_path)
@surbhiD When you call download.save_as(download_path), the downloaded file should be saved at the path you've specified. However, that path is not connected to the browser UI in any means, so clicking in the UI will not open it.
If you think that download.save_as(download_path) did not work as expected, please provide a full self-contained repro so that we can reproduce locally and fix the bug.
Version
1.46.0
Steps to reproduce
Opened the browser
navigated to page
filled the details on page and clicked on export button
Actual : some random id is visible on screen but not able to open it .The file is saved no where
expected: correct file name should get downloaded.also on page the correct file names appears near download icon of page
Expected behavior
expected: correct file name should get downloaded.also on page the correct file names appears near download icon of page
Actual behavior
Actual : some random id is visible on screen but not able to open it .The file is saved no where
Additional context
this is how i am launching the browser def create_browser(self):
"""
Creates a browser instance for Chrome using Playwright.
"""
try:
self.browser = self.playwright.chromium.launch(
channel= 'chrome',
headless = False,
slow_mo = 1000,
also for download using this code def download_file(self, timeout_seconds):
"""
Waits for a download to complete within the specified timeout.
def file_download_implementation():
if dimension_type is not None and file_extension is not None:
self.get_element('Common_Report_Btn', *[dimension_type, dimension_type]).click_element()
elif dimension_type is None and link is not None:
self.get_element('Common_link', link).click_element()
else:
file_extension=dimension_type
self.get_element('Export_Btn').click_element()
Environment
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Memory: 2.46 GB / 15.84 GB
Binaries:
Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
VSCode: 1.94.2 - C:\Users\dhsu3001\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
The text was updated successfully, but these errors were encountered: