如何将值发送到 Robot Framework 中的日期选择器? [英] How do I send value to a date picker in Robot Framework?

查看:40
本文介绍了如何将值发送到 Robot Framework 中的日期选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用机器人框架自动填写表单.可以将值传递给文本字段、下拉列表等,停留在日期.有做过的朋友请帮忙.

I am trying to automate form filling using robot framework. Could pass values to text fields, drop down list etc, stuck at date. Anyone who has done please help.

推荐答案

您可以发送,例如从今天起 6 天后的日期,直接通过使用 javascript 设置 datepicker 元素的值:

You can send, e.g. a date 6 days from today, directly by setting the value of the datepicker element with javascript:

${my_date_to_select}= Get Current Date    UTC    6 days   %d/%m/%Y
Execute JavaScript  document.getElementById('ID_OF_YOUR_DATEPICKER').value='${my_date_to_select}'

注意:为了使用关键字获取当前日期",您需要在设置中添加库 DateTime.

NB: In order to use the keyword 'Get Current Date', you need to add the library DateTime in your settings.

这篇关于如何将值发送到 Robot Framework 中的日期选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆