一旦以太网属性弹出并可以选择正确的组合列表,任何人都可以帮助我如何切换选项卡。我需要选择共享选项卡,如屏幕截图所示。
提前致谢 !!
代码如下:
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')