代码之家  ›  专栏  ›  技术社区  ›  Nova

复制文本并粘贴到UFT中

  •  0
  • Nova  · 技术社区  · 8 年前

    以下是我迄今为止所做的尝试,但没有成功

    这是我的代码:

    Browser("Candidate").Page("Candidate").WebEdit("ctl00$Main$Tabs").GetROProperty + micCtrlDwn + "a" + micCtrlUp
    Browser("Candidate").Page("Candidate").WebEdit("ctl00$Main$Tabs").GetROProperty + micCtrlDwn + "c" + micCtrlUp
    Browser("Candidate").Page("Candidate").WebEdit("ctl00$Main$TabsCPe_3").Click
    Browser("Candidate").Page("Candidate").WebEdit("ctl00$Main$TabsCPe_3").GetROProperty + micCtrlDwn + "v" + micCtrlUp
    

    它点击我需要它复制文本的字段,但没有选择所有文本并将其复制到定义的目标。

    Object properties for feild1 after entering text manually

    feild1 object spy

    1 回复  |  直到 8 年前
        1
  •  3
  •   Gurmanjot Singh    8 年前

    为什么不从field1中获取值,将其存储在变量中,然后将该值设置为field2,如下所示:

    Dim strValue
    'fetch the value from field1 and store it in a variable
    strValue = Browser("Candidate").Page("Candidate").WebEdit("ctl00$Main$Tabs").getRoProperty("value")
    
    'set that value to field2
    Browser("Candidate").Page("Candidate").WebEdit("ctl00$Main$TabsCPe_3").set strValue