ropensci / RSelenium

An R client for Selenium Remote WebDriver
https://docs.ropensci.org/RSelenium
341 stars 81 forks source link

$switchToWindow() not working on Chrome browser #239

Open LuizOli opened 3 years ago

LuizOli commented 3 years ago

Operating System

Windows 10

Selenium Server version (selenium-server-standalone-3.0.1.jar etc.)

4.0.0-alpha-2

Browser version (firefox 50.1.0, chrome 54.0.2840.100 (64-bit) etc.)

Chrome - 87.0.4280.88

Expected behaviour

client$switchToWindow(WindowId= xx)

Should switch the window/tab focus

Actual behaviour

It does not

Steps to reproduce the behaviour

Just load up the package and try to switch tabs on Chrome

I got it to switch the window by manualy using the $queryRD method from the client class and changing the qdata to list(handle = "the tab to focus")

cliente$queryRD(
    sprintf(
      "%s/session/%s/window",
      cliente$serverURL,
      cliente$sessionInfo[["id"]]
    ),
    "POST",
    qdata = list(handle = "acctual tab handle id")
  )

the original method has the qdata payload set "name" instead of "handle".

taiyodayo commented 3 years ago

try this method? https://github.com/ropensci/RSelenium/issues/143

ducnt10 commented 1 year ago

I did it like this and it worked (for chrome): cliente$queryRD( sprintf( "%s/session/%s/window", cliente$serverURL, cliente$sessionInfo[["id"]] ), "POST", qdata = list(name= "acctual tab handle id") )