Pywinauto for changing mutliple tabs for Multiple Windows Tab

  python, pywinauto, ui-automation, windows

Can anyone help me on how to switch the tab once the ethernet properties popped up and can select proper combo list. I need to select Sharing tab as shown on the screenshot.

Thanks in Advance !!

Code as below :

from __future__ import print_function
import pywinauto,time,keyboard
from pywinauto import Application
from pywinauto.keyboard import send_keys

# Open "Control Panel"
Application().start('control.exe')
app = Application(backend='uia').connect(path='explorer.exe', title='Control Panel')

# Go to "Programs"

app.window(title="Control Panel").NetworkandInternetHyperlink.invoke()
app.wait_cpu_usage_lower(threshold=0.5, timeout=30, usage_interval=1.0)

# Go to "Installed Updates"

app.window(title='Network and Internet').child_window(title='View network status and tasks', control_type='Hyperlink').invoke()
app.wait_cpu_usage_lower(threshold=0.5, timeout=30, usage_interval=1.0)
app.window(title="Network and Sharing Center").ChangeadaptersettingsHyperlink.invoke()

list_box = app.NetworkConnections.FolderViewListBox

# list all updates
items = list_box.descendants(control_type='ListItem')
all_updates = [item.window_text() for item in items]
print('nAll updates ({}):n'.format(len(all_updates)))
print(all_updates)

# list updates from "Microsoft Windows" group only
app.window(title='Network Connections').EthernetHyperlink.invoke()
app.Ethernet_Properties.TabControlNetworking.select("Authentication")
dlp = app.top_window()
dlp.type_keys('ctrl+tab')

enter image description here

Source: Windows Questions

LEAVE A COMMENT