Read Two Cell Raw Data And Loop In Selenium Vba

aejaz7

New Member
Joined
Nov 6, 2018
Messages
20
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
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top