将文本从剪贴板插入selenium ide脚本

时间:2018-04-01 06:43:06

标签: web-scraping selenium-ide imacros browser-automation

以下是我用kantu selenium ide录制的以下宏。而不是" 456"正在输入,我想从剪贴板粘贴一个数字,我将如何使用!剪贴板来做到这一点?

{
    "CreationDate": "2018-3-28",
    "Commands": [
      {
        "Command": "open",
        "Target": "http://www.myurlhere.com/",
        "Value": ""
      },
      {
        "Command": "click",
        "Target": "id=ContentPlaceHolder1_txtCode",
        "Value": ""
      },
      {
        "Command": "type",
        "Target": "id=ContentPlaceHolder1_txtCode",
        "Value": "456"
      }

1 个答案:

答案 0 :(得分:0)

我自己找到了解决方案:$ {!clipboard}是GET (paste) a value from the clipboard的正确语法:

  {
    "Command": "type",
    "Target": "id=ContentPlaceHolder1_txtCode",
    "Value": "${!clipboard}"
  }

要设置剪贴板(复制)的值,可以使用:

  {
    "Command": "store",
    "Target": "my data here",
    "Value": "!clipboard"
  }