require 'watir-webdriver'
require 'win32ole'
require 'roo'
b= Watir::Browser.new(:firefox)
b.goto('https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=http://mail.google.com/mail/&scc=1<mpl=default<mplcache=2')
xl = WIN32OLE.new('excel.application')
wrkbook= xl.Workbooks.Open("C:\\Excel\\mondial1.xlsx")
wrksheet= wrkbook.Worksheets(1)
wrksheet.Select
username1= wrksheet.Range("a1").Value
password1= wrksheet.Range("b1").Value
b.text_field(:id, "Email").set("username1")
b.text_field(:id, "Passwd").set("password1")
b.button(:id, "signIn").click
xl.Quit
Excelシートを開いてそこから値を取得したいのですが、Gmailのテキストフィールドへの入力としてそれを提供する必要があります。
Excelシートから値を取得する代わりに* 「username1」として直接設定されます* Excelを介して値を渡す必要があり ます事前に感謝の意を表します