簡體   English   中英

如何使用 Rselenium 修改 colors?

[英]How to modify colors using Rselenium?

我想使用Rselenium更改本網站 ( https://www.qrcode-monkey.com/#url ) 的前景色和背景色

在此處輸入圖像描述

我們必須先清除該字段以設置新值,

#launch browser
driver = rsDriver(browser = c("firefox"))
remDr <- driver[["client"]]
remDr$navigate('https://www.qrcode-monkey.com/#url')

remDr$findElement('xpath', '/html/body/div[2]/div[2]/div[2]/div/div/div[1]/div/div[2]/div[1]/h3')$clickElement()
remDr$findElement(using = "xpath", '/html/body/div[2]/div[2]/div[2]/div/div/div[1]/div/div[2]/div[2]/div[1]/div[4]/div/color-picker/div/div[1]/input')$clickElement()
webElem = remDr$findElement(using = "xpath", '/html/body/div[2]/div[2]/div[2]/div/div/div[1]/div/div[2]/div[2]/div[1]/div[4]/div/color-picker/div/div[1]/input')
webElem$sendKeysToElement(list(key = 'backspace'))  #repeat the step six times to clear the field
#set color to red
webElem$sendKeysToElement(list("#FF0000"))

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM