如何使用 Rselenium 移动滑块?
how to move slider using Rselenium?
我正在尝试将滑块移动到最大 2000 像素
driver = rsDriver(browser = c("firefox"))
remDr <- driver[["client"]]
remDr$navigate('https://www.qrcode-monkey.com/#url')
webElem <- remDr$findElement("xpath", "//span[@class='rz-pointer rz-pointer-min']")
我已经尝试过这些命令,但它不起作用
webElem$buttondown(2)
webElem$setElementAttribute("aria-valuetext", 2000)
我们可以简单地点击指针然后按 end
#launch browser
driver = rsDriver(browser = c("firefox"))
remDr <- driver[["client"]]
remDr$navigate('https://www.qrcode-monkey.com/#url')
#click element
remDr$findElement(using = "xpath",'/html/body/div[2]/div[2]/div[2]/div/div/div[2]/div[2]/div[1]/div/div[1]/span[5]')$clickElement()
#press end
webElem <- remDr$findElement(using = "xpath",'/html/body/div[2]/div[2]/div[2]/div/div/div[2]/div[2]/div[1]/div/div[1]/span[5]')
webElem$sendKeysToElement(list(key="end"))
我正在尝试将滑块移动到最大 2000 像素
driver = rsDriver(browser = c("firefox"))
remDr <- driver[["client"]]
remDr$navigate('https://www.qrcode-monkey.com/#url')
webElem <- remDr$findElement("xpath", "//span[@class='rz-pointer rz-pointer-min']")
我已经尝试过这些命令,但它不起作用
webElem$buttondown(2)
webElem$setElementAttribute("aria-valuetext", 2000)
我们可以简单地点击指针然后按 end
#launch browser
driver = rsDriver(browser = c("firefox"))
remDr <- driver[["client"]]
remDr$navigate('https://www.qrcode-monkey.com/#url')
#click element
remDr$findElement(using = "xpath",'/html/body/div[2]/div[2]/div[2]/div/div/div[2]/div[2]/div[1]/div/div[1]/span[5]')$clickElement()
#press end
webElem <- remDr$findElement(using = "xpath",'/html/body/div[2]/div[2]/div[2]/div/div/div[2]/div[2]/div[1]/div/div[1]/span[5]')
webElem$sendKeysToElement(list(key="end"))