SeleniumBasic
SeleniumBasic copied to clipboard
Unable to select right click menus
I am struggling how to select second item of the context click menu. Someone help on this.
Sub Macro1() Dim driver As New Selenium.WebDriver Dim key As New Selenium.Keys driver.Start "chrome" driver.Get "https://www.linkedin.com/company/gigaclear" driver.Wait (3000) driver.FindElementByCss("#biz-follow-mod > div > div > p > strong").ClickDouble driver.FindElementByCss("#biz-follow-mod > div > div > p > strong").ClickContext driver.Wait (3000) driver.SendKeys (key.Down) driver.SendKeys (key.Down) driver.SendKeys (key.Space) driver.Wait (3000) End Sub
Can you provide a little bit more information on what you are trying to achieve?
My main goal of this coding is to right click the given element value and select one of the option from the right click menu.
I got that from the first post. It would be usefully to know which element is supposed to get the context menu and which action you want to select in the context menu.
Css Selector: #biz-follow-mod > div > div > p > strong
This element is need to do the right click and select the second context menu from the list.
Anyone have any luck on this? Thanks! Dan
usando selenium em VBA.
bot.FindElementByCss("#image-control > img").ClickContext 'CreateObject("wscript.shell").SendKeys "+{F10}" 'Right click mouse, bad using Application.Wait Now + TimeValue("00:00:01") SendKeys "{ENTER}", True Application.Wait Now + TimeValue("00:00:01") SendKeys "{ENTER}", True Application.Wait Now + TimeValue("00:00:02")