Hi,
I'm not sure I fully understand the issue. Is it just the looping part you're having difficulty with? In that case, you can just wrap the whole piece into a loop function that increments the records by 500 each time.
#Set start, end and steps
start = 1
n = 1200
steps = 500
#Loop through
records = c(seq(start, n, steps), (n+1))
for(x in 1:(length(records)-1)){
# This is example of the line you like to edit
# .. prev code ...
# webElem1$sendKeysToElement(list(as.character(records[x]), key = "tab", as.character(records[x+1] -1)))
# ... next code ...
#Remove this, just for showing what it'd look like
print(sprintf("webElem1$sendKeysToElement(list(%s, key = \"tab\", %s))",
as.character(records[x]), as.character(records[x+1] - 1)))
}
#> [1] "webElem1$sendKeysToElement(list(1, key = \"tab\", 500))"
#> [1] "webElem1$sendKeysToElement(list(501, key = \"tab\", 1000))"
#> [1] "webElem1$sendKeysToElement(list(1001, key = \"tab\", 1200))"
Created on 2020-08-12 by the reprex package (v0.3.0)
If this is not what you're looking for, please elaborate
Hope this helps,
PJ