我正在使用pywinauto自動執行應用程序。我用PrintControlIdentifiers
打印對象名稱和屬性。很少有編輯框在名稱中有空格。這裏有一個例子:如何使用SetText作爲名稱在python代碼中有空格的編輯框
| [u'Cr. PriceEdit1', u'Cr. PriceEdit0', u'Tr. PriceEdit']
| child_window(class_name="Edit")
我不能使用parentWindow.Cr. PriceEdit1.SetText("name1")
,因爲它會導致編譯錯誤。如何在代碼中使用此控件來執行SetText
?
注意:我知道使用child_window(title="Cr. PriceEdit0", class_name="Edit")
,但仍然想知道是否有方法可以直接使用SetText和編輯框名稱。
注:我知道使用child_window(標題=「鉻。PriceEdit0「,class_name =」Edit「),但仍想知道是否有方法可以直接使用SetText和編輯框名稱。 –