I just want to read two cell raw which contain from date and to date using selenium vba. But i am unable to loop data till last cell exist.
VBA Code:
Sub Test()
Dim obj As New WebDriver,i As Integer,mysheet As Worksheet
Set mysheet = Sheets("Sheet2")
LastRow = mysheet.Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow
obj.FindElementByXPath("//form[@id='sum_led']/div[2]/div/div/input").SendKeys Sheet1.Cells(i, 1)
Application.Wait Now + TimeValue("00:00:01")
obj.FindElementByXPath("//form[@id='sum_led']/div[2]/div[2]/div/input").SendKeys Sheet1.Cells(i, 2)
Application.Wait Now + TimeValue("00:00:01")
obj.FindElementByXPath("//form[@id='sum_led']/div[2]/div[3]/button").Click
Application.Wait Now + TimeValue("00:00:02")
Next