Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Mouse Clicks to IE (... Like oWSH.SendKeys() sends keys)? 2

Status
Not open for further replies.

mydocpro

Technical User
Mar 13, 2016
48
US
... I would like to open a drop down list which seems to require a mouse click ...

Code:
oWSH = CREATEOBJECT("wscript.shell")
oWSH.AppActivate("Google Chrome")   && assumes Google Chrome is running
oWSH.SendKeys('{TAB}')	&& tab to a dropdown list ... but to drop it down seems to require a mouse click

Do any of you know how to make a list open in IE (Google) ... that seems to require a click?
Or do you know a work-around to get a list to open (drop down) in IE (Google)?

Utmost thanks in advance,
Philip
 
Thanks Mike,

I may be able use an IE dom workaround with this.

So I gather sendkeys() cannot send a mouse click, especially in Chrome.

Utmost thanks/blessings,
Philip
 
You cannot use SendKeys() to send a mouse click, but there is nearly always a keyboard alternative. In most cases, sending Enter when a dropdown has focus is the same as clicking with the mouse. (At least, that's true with FireFox, so probably with Chrome as well.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike, I will keep trying (most IE dropdown lists respond to <enter>, this is more of a dropdown browser ('guised as a dropdown list)

Utmost thanks/blessings!
Philip
 
Philip,

For what it's worth, I just tried your code with Chrome. Sending ENTER works fine.

This is what I did:

Code:
oWSH = CREATEOBJECT("wscript.shell")
oWSH.AppActivate("Google Chrome")   && assumes Google Chrome is running
oWSH.SendKeys('{TAB}')	            && assumes focus is on control before the drop-down
oWSH.SendKeys('{ENTER}')

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top