1

I am trying to stimulate the control+v option in a text box in chrome using selenium vba wrapper. I tried using the context click but that function seems to click at a random position based on the cursor position. I tried using the send key function but i am not getting the desired result.

selenium.SendKeys (key.Control & "v")

Please any advise or leads would be much appreciated.

2 Answers 2

3

You want to target the text box before using sendkeys. Let's say, hypothetically, that there is an ID called textbox1 for identifying the element then:

driver.FindElementById("textbox1").SendKeys("yourString")

Or

driver.FindElementById("textbox1").SendKeys Keys.Control, "v"

The latter assuming info is already in the clipboard with, for example, driver.SetClipBoard "yourString"

Sign up to request clarification or add additional context in comments.

Comments

0

I think you'll be better off using a variable to hold your data rather than the clipboard. Then you can use sendkeys to type it in:

myData= "your data here"
selenium.sendkeys myData

hth

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.