I am trying to resize a window (with robotframework), using PyWinAuto, though I am getting an error message:
KEYWORD screen_resolution . Set Resolution ${window}, 1800, 800
Start / End / Elapsed: 20240530 16:36:00.075 / 20240530 16:36:00.127 / 00:00:00.052
16:36:00.075 FAIL ArgumentError: argument 1: <class 'TypeError'>: expected WinFunctionType instance instead of WinFunctionType
The code that I am having for the py file is:
import pyautogui
from PIL import Image
import pygetwindow as gw
def change_resolution(window_title, width, height):
width = int(width)
height = int(height)
"""
Change the resolution of the specified window to the given dimensions.
Arguments:
window_title: The title of the window.
width: The new width of the window.
height: The new height of the window. """
window = gw.getWindowsWithTitle(window_title)
if window:
window = window[0]
window.resizeTo(width, height)
window.moveTo((window.width - width) // 2, (window.height - height) // 2)
print("xxx" + window_title)
else:
print("The window with the specified title was not found." + window_title)
# Define the keyword through which we change the screen resolution to the desired specifications
def set_resolution(window_title, width, height):
change_resolution(window_title, width, height)**your text**
I have tried importing other libraries, though that didn’t help.
Also, it is worth mentioning that this code is running inside a VM on mac (M2 processor)