Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
546 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Posted by Andrew Gould on 31 July 2021
Learn how to hold down modifier keys such as Shift, Ctrl and Alt when you click a link in Google Chrome using Selenium for VBA.
See our full range of VBA training resources, or test your knowledge of VBA with one of our VBA skills assessment tests.
There are no files which go with this video.
There are no exercises for this video.
You can increase the size of your video to make it fill the screen like this:
Play your video (the icons shown won't appear until you do), then click on the full screen icon which appears as shown above.
When you've finished viewing a video in full screen mode, just press the Esc key to return to normal view.
To improve the quality of a video, first click on the Settings icon:
Make sure yoiu're playing your video so that the icons shown above appear, then click on this gear icon.
Choose to change the video quality:
Click as above to change your video quality.
The higher the number you choose, the better will be your video quality (but the slower the connection speed):
Don't choose the HD option shown unless your connection speed is fast enough to support it!
Is your Wise Owl speaking too slowly (or too quickly)? You can also use the Settings menu above to change your playback speed.
From: | JoeNoEskimo |
When: | 26 Apr 23 at 04:15 |
Hi Andrew,
I figured out the key to setting focus on the popup form, I just had to get the correct element. Now I'm on to setting check boxes. :-) I think your part 57.7 on drop down lists has me going in the right direction.
Thanks again,
Joe
From: | Andrew G |
When: | 26 Apr 23 at 07:01 |
Sounds like you're making good progress!
From: | JoeNoEskimo |
When: | 27 Apr 23 at 03:45 |
Hey Andrew, I beat it into submission!
This worked to select the option I want:
Set DropDownOption = ChromeDriver.FindElementByCss(".search-bar-left")
DropDownOption.Click
ChromeDriver.Wait 1000
Set DropDownOption = ChromeDriver.FindElementByXPath("//*[@id='add-search-household-component']/div/div[3]/div/div/div/div/div[3]")
ChromeDriver.Wait 1000
DropDownOption.Click
But, if you have anything else to share on non-select element drop downs, I'd welcome it.
Thanks again,
Joe
From: | Andrew G |
When: | 27 Apr 23 at 06:47 |
Hi Joe!
That looks as good a solution as any. The important thing is that it works!
From: | JoeNoEskimo |
When: | 27 Apr 23 at 02:49 |
Hi Andrew,
Your code helped me loop through the checkbox element and get the ids that let me select them, but now I'm trying to select a value from a drop down and have not found the trick yet. Unfortunately it is not a select element, it is a series of dev statements, kind of like you mentioned at minute 2.22 in video 57.7.
This code gave me the ids for the checkboxes which allows me to select the ones I want:
Set CheckBoxOptions = ChromeDriver.FindElementsByCss(".parent-label")
For Each CheckBoxOption In CheckBoxOptions
Debug.Print CheckBoxOption.text, CheckBoxOption.Attribute("id")
Next CheckBoxOption
Choice Pantry label-for-primaryServicesFormControl-IndependenceFoodbasket-ChoicePantry
Food Pantry - TEFAP label-for-primaryServicesFormControl-IndependenceFoodbasket-FoodPantry-TEFAP
Rent Assistance label-for-primaryServicesFormControl-IndependenceFoodbasket-RentAssistance
Utility Assistance label-for-primaryServicesFormControl-IndependenceFoodbasket-UtilityAssistance
Prescription Assistance label-for-primaryServicesFormControl-IndependenceFoodbasket-PrescriptionAssistance
Fuel Assistance label-for-primaryServicesFormControl-IndependenceFoodbasket-FuelAssistance
But similar code is not working for the drop down, no ids.:-(
Set DropDownOption = ChromeDriver.FindElementByCss(".search-bar-left")
DropDownOption.Click
ChromeDriver.Wait 1000
Set DropDownOptions = ChromeDriver.FindElementsByCss(".overlay-container")
For Each DropDownOption In DropDownOptions
Debug.Print DropDownOption.text, DropDownOption.Attribute("id")
Next DropDownOption
Alt. Id
Address
Date of Birth
Name
Phone #
Did I miss a video where you showed how to select a value from this type of drop down?
Thanks,
Joe
From: | JoeNoEskimo |
When: | 24 Apr 23 at 19:18 |
Hello. Thanks so much for your videos. I am trying to send the Enter key to a website via SeleniumBasic. I have been beating my head against the wall for several hours now. Nothing is working. I tried to do the following like you did for Shift in this video.
Dim URL As String, ChromeDriver As selenium.ChromeDriver
Dim Keys As New selenium.Keys
Dim Element As selenium.WebElement
ChromeDriver.Get URL
ChromeDriver.FindElementByName("queryString").SendKeys (NeighborName)
Set Element = ChromeDriver.FindElementByName("queryString")
Element.Click Keys.Enter
But no luck.
This is after trying several other methods including:
ChromeDriver.FindElementByName("queryString").SendKeys (Keys.Enter)
Any help you can offer would be greatly appreciated.
Thanks,
Joe Jones
From: | Andrew G |
When: | 25 Apr 23 at 07:22 |
Hi Joe!
You could try the Application.SendKeys method
Application.SendKeys "{ENTER}"
I hope it helps!
From: | JoeNoEskimo |
When: | 26 Apr 23 at 00:22 |
Thanks Andrew. I had tried that too. But, I got around that issue using what I learned from you on the FindElementByCss cmd, I had been trying by class, but it was throwing an error. There was an icon for to initiate the search that I was able to find and click on instead of sending an Enter key.
Now I'm on to the next challenge, setting focus to a popup form so I can populate fields on it. I thought maybe the SwitchToNextWindow cmd you demoed in 57.6 might work, but its not another tab, its a popup window.
BTW, I am new to Selenium and HTL in general, your videos have been very helpful, thanks! My expertise is in MS Access. My current project is to write data from my food pantry database to a volunteer hours website to remove the need for double entry.
Joe
From: | Andrew G |
When: | 26 Apr 23 at 07:01 |
Happy to hear that you found a solution Joe, good luck with your project!
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.