sendkeys selenium vba from copied selection in excel

Viewed 31

I am trying to copy a range of cells to the clipboard and paste it.

Global bot As New ChromeDriver, post As Object
Public MyElement As selenium.WebElement
Public Keys As selenium.Keys

Sub copyPasteintoGoogleSearchBar()
  
 Set Keys = CreateObject("Selenium.Keys")
  
    loginAndGoToTesting
    
    With bot
        Range("A2:L2").Copy
        .FindElementByName("q").SendKeys (Keys.Control  + "v")   
    End With
End Sub

Function loginAndGoToTesting()

With bot
    .Timeouts.ImplicitWait = 1000
   ' .AddArgument "--headless"
    .Start
    .get "https://www.google.com/"
    bot.Window.SetSize 2000, 1200
    bot.Window.Maximize
    bot.Refresh
End With
End Function

It will act like it is doing something and then nothing. If you manually right click on the url(not seeing a way to clickContext with selenium on the Url) before sending keys of ctrl and v it will paste in. rick click(click context) on the google search bar does not change the result of it not pastin

0 Answers
Related