RSelenium icon indicating copy to clipboard operation
RSelenium copied to clipboard

$switchToWindow() not working on Chrome browser

Open LuizOli opened this issue 4 years ago • 2 comments
trafficstars

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".

LuizOli avatar Jan 11 '21 18:01 LuizOli

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

taiyodayo avatar Mar 10 '21 06:03 taiyodayo

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") )

ducnt10 avatar Nov 20 '22 17:11 ducnt10