我正在 gmail 登录页面上开发示例 gmail 登录应用程序。
当我单击“创建帐户”链接时,会显示一个新页面,在此页面中我想访问月份(“生日”部分)。
我尝试使用 div 元素,它给出了一个错误,你能帮我解决一下吗?
最佳答案
请尝试一下,它会正常工作
require 'watir-webdriver'
ie=Watir::Browser.new :firefox
ie.goto "https://accounts.google.com/SignUp?continue=https%3A%2F%2Fwww.google.co.in%2Fsearch%3Fq%3Dgoog%26oq%3Dgoog%26aqs%3Dchrome..69i57j69i60l5.807j0%26sourceid%3Dchrome%26espv%3D210%26es_sm%3D93%26ie%3DUTF-8&hl=en"
ie.div(:text,"Month").click
#here you can put your month you want to select
ie.div(:text,"March").click
#select date here
ie.text_field(:id, "BirthDay").set "11"
#select year here
ie.text_field(:id, "BirthYear").set "1992"
关于ruby - 使用 Watir 进行 Gmail 注册访问网页元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19200986/