使用机器人框架从屏幕复制文本

时间:2019-05-21 09:08:45

标签: robotframework

是否可以使用机器人框架从网站复制文本?我需要让机器人通过我们的网站填写表格,然后复制保存的表格标题。

每个标题都是唯一的,并且在保存表单后在屏幕上可见。

然后我想使用标题文本来测试我们的搜索功能。

2 个答案:

答案 0 :(得分:1)

这成功了!

    public GameObject effect;
    public GameObject objj;
    public Transform pl;
    void Start()
    {

        Instantiate(objj, new Vector3(0, 3, -1), Quaternion.identity);
    }
    void FixedUpdate()
    {
        transform.Rotate(new Vector3(0, 0, Time.deltaTime * speed));
    }
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Player"))
        {
            Instantiate(effect, pl.position, Quaternion.identity);
            Instantiate(objj, new Vector3(0, 3, -1), Quaternion.identity);
            Destroy(other.gameObject);

        }
    }

答案 1 :(得分:0)

${variable} = 获取文本 ${locator}

在我的例子中,这样的构造直到我从 SeleniumLibrary 添加“Scroll Element Into View”关键字后才返回值

这是我必须做的:

Scroll Element Into View  ${locator} 
${variable} =  Get Text  ${locator}
相关问题