Giter Club home page Giter Club logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
Can you provide an example of what you are trying to achieve?
If it's just to clear the windows clipboard, you can use the toClipboad command 
:

Dim driver As New SeleniumWrapper.WebDriver
driver.Start "firefox", "http://www.google.com"
driver.Open "/"
...
driver.toClipboad ""

Original comment by florentbr on 15 Jan 2014 at 4:08

  • Changed state: Accepted

from selenium-vba.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024

Original comment by florentbr on 15 Jan 2014 at 4:09

  • Added labels: Type-Support
  • Removed labels: Type-Defect

from selenium-vba.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
Sub Gamespot()

Dim driver As New SeleniumWrapper.WebDriver
Dim shell: Set shell = CreateObject("WScript.Shell")

    'I tab over to a combo text calendar widget , Because I cant find the elements name
shell.SendKeys "{TAB 22}"
    'I select the date i manually right down cell B1 to copy and paste in the combotext calender widget. This works great.
Sheets("Sheet1").Select
Application.CutCopyMode = False
Application.Sheets("Sheet1").Range("B1").Copy
shell.SendKeys "^v"
driver.Wait 1000


    'But when I try this same method over again exception being cell D1. It paste's the same as B1, which was copied previously.
Sheets("Sheet1").Select
Application.CutCopyMode = False
Application.Sheets("Sheet1").Range("D1").Copy
shell.SendKeys "{TAB 2}"
shell.SendKeys "^v"

    'I did go on to notice that after this ran threw it was on the correct range "D1" and it was highlighted that it was copied and if selected another cell in excel and pasted it would do the correct value. But if I were to click back into the same driver web page to paste it would paste what was previously pasted in the B1 Cell

I am curious if i could clear the clip board in driver before i copy my D1 
cell. If that would do the fix. I also wouldn't know how to do that, if you 
could walk me threw or if there are any other alternatives id be happy to hear.

Original comment by [email protected] on 16 Jan 2014 at 6:28

from selenium-vba.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
I wouldn't recommend to use the WScript.Shell to emulate the keyboard as it's 
not attached to the browser.
There's multiple ways to select a page element, like by id or with a Css 
selector and you can easily paste some text using the webdriver:

Dim driver As New SeleniumWrapper.WebDriver
Dim Keys As New SeleniumWrapper.Keys
driver.SendKeys String(22, Keys.Tab)
driver.toClipBoard Application.Sheets("Sheet1").Range("B1").Text
driver.Wait 500
driver.SendKeys Keys.Control & "v"
driver.Wait 500
...

I think you case is a timing issue. The cell text must still be on its way to 
the clipboard while you are trying to past it.
Try to had a wait command before sending the Ctrl+v.

Original comment by florentbr on 16 Jan 2014 at 10:15

from selenium-vba.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
I got it to work with your advice where could i go to read more about Css. I 
seem to have problems plugging in data into DateTimePicker  and ComboBox'es.

Original comment by [email protected] on 17 Jan 2014 at 1:20

from selenium-vba.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
Here is some examples on Css locators :
http://www.natontesting.com/2011/09/24/css-locator-referencecheat-sheet-for-xpat
h-people/
http://software-testing-tutorials-automation.blogspot.co.uk/2013/06/selenium-css
-locators-tutorial-with.html

You can also select the Css in Selenium IDE once the action has been recorded 
and test some other by clicking on "Find"

The Selenium 1 format is :
driver.click "css=selector"
driver.type "css=selector", "text"
...

The Selenium 2 format is :
set ele = driver.findElementByCssSelector("selector")
ele.click
ele.sendKeys "text"

Original comment by florentbr on 17 Jan 2014 at 9:47

from selenium-vba.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024

Original comment by florentbr on 8 Sep 2014 at 5:40

  • Changed state: Done

from selenium-vba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.