Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从SAP应用程序自定义容器中的文本框获取值_Sap_Autoit - Fatal编程技术网

从SAP应用程序自定义容器中的文本框获取值

从SAP应用程序自定义容器中的文本框获取值,sap,autoit,Sap,Autoit,我的要求是使用AutoIt自动化SAP流程。当我试图从下面的用户名文本框中获取值(测试)时,它没有获取文本框值并显示空值。我想从文本框中获取值,并需要与字符串进行比较。你能帮我一下吗 输出: 我已经提到了以下链接: AutoIt finder工具的屏幕截图: 我的自动IT代码: Run("C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe") Local $hWnd = WinWaitActive("SAP Logon

我的要求是使用AutoIt自动化SAP流程。当我试图从下面的用户名文本框中获取值(测试)时,它没有获取文本框值并显示空值。我想从文本框中获取值,并需要与字符串进行比较。你能帮我一下吗

输出:

我已经提到了以下链接:

AutoIt finder工具的屏幕截图:

我的自动IT代码:

Run("C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe")
Local $hWnd = WinWaitActive("SAP Logon 740")

WinSetState($hWnd, "", @SW_MAXIMIZE)

ControlFocus("SAP Logon 740","","SAPTreeList1")
ControlTreeView("SAP Logon 740","","[CLASS:SAPTreeList; INSTANCE:1]","Expand","#0")
ControlClick("SAP Logon 740","","[CLASS:SAPTreeList; INSTANCE:1]","left",2,47,60)
Sleep(2000)
ControlClick("SAP Logon 740","","[CLASS:SAPTreeList; INSTANCE:1]","left",2,59,115)
Sleep(2000)
ControlClick("SAP Logon 740","","[CLASS:SysListView32; INSTANCE:1]","left",1,71,573)

Sleep(1000)
ControlClick("SAP Logon 740","","Log &On")
Sleep(3000)
Local $hNewWnd = WinWaitActive("SAP")
; Retrieve the classlist of the Notepad window using the handle returned by WinWait.
    Local $sClassList = WinGetClassList("SAP")
#ConsoleWrite($sClassList)
    ; Display the classlist.
Sleep(3000)
ControlClick("SAP","","","left",1,179,56)
    # MsgBox(0, "output", $sClassList)
Send("test")
Sleep(1000)
$wrd = ControlGetText("SAP","test","")
MsgBox(0,"Display",$wrd)
控制选项卡:

请阅读和

请阅读和


你完全搞错了。当你聚焦用户名编辑框时,显示窗口信息工具中的“控制”选项卡。感谢@Milos的评论。请找到“控制选项卡”的屏幕截图。类别:Afx:68570000:1008实例:1类别名称NN:Afx:68570000:10081名称:高级(类别):[Class:Afx:68570000:1008;实例:1]ID:100文本:位置:0,104大小:1510,653控件单击坐标:192,56样式:0x56000000 ExStyle:0x00000010句柄:0x00020256您完全搞错了。当你聚焦用户名编辑框时,显示窗口信息工具中的“控制”选项卡。感谢@Milos的评论。请找到“控制选项卡”的屏幕截图。类别:Afx:68570000:1008实例:1类别名称NN:Afx:68570000:10081名称:高级(类别):[Class:Afx:68570000:1008;实例:1]ID:100文本:位置:0,104大小:1510,653控制点击坐标:192,56样式:0x56000000 ExStyle:0x00000010句柄:0x00020256谢谢@Milos。我尝试了上述代码,但仍然无法重新保留测试值。。请您解释一下上述代码与从SAP customer container中的文本字段中获取值的关系。。。。。AutoIT v3窗口信息选项未聚焦特定字段,而是聚焦帧。。你能帮我们了解更多细节吗。。请参考我的上述代码谢谢@Milos。我尝试了上述代码,但仍然无法重新保留测试值。。请您解释一下上述代码与从SAP customer container中的文本字段中获取值的关系。。。。。AutoIT v3窗口信息选项未聚焦特定字段,而是聚焦帧。。你能帮我们了解更多细节吗。。请参考我的上述代码
#RequireAdmin ;sometimes this is required in order to be able to manipulate windows
Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
Opt("WinSearchChildren", 1) ;0=no, 1=search children also

$wrd = ControlGetText("[TITLE:SAP]","",100);100 is id from the WindowInfo Tool
If @error Then $wrd = ControlGetText("[TITLE:SAP]","","[CLASS:Afx:68570000:1008; INSTANCE: 1]")
;This is the advanced method. Aslo shown in the WIndowInfo Tool.
MsgBox(0,"Display",$wrd)