Clickcontext and copy

Asked

Viewed 322 times

0

Good morning.

My code is like this

Sub pegadadoschrome()

Dim obj As New webdriver
Dim keys As selenium.keys
Set keys = New selenium.keys
obj.Start "chrome", ""
obj.get "https://gvt.etadirect.com/"
Dim txt As String
Dim txt1 As String


obj.FindElementById("username").SendKeys ("USER1")
obj.FindElementById("password").SendKeys ("$123T*")
obj.FindElementByName("user_submitted_login_form").Click ("")
Application.Wait (Now + TimeValue("0:00:02"))
obj.FindElementById("password").SendKeys ("$123T*")
obj.FindElementByXPath("/html/body/div[1]/div/div[4]/div[1]/form/div[5]/label/span[1]").Click ("")
obj.FindElementByName("user_submitted_login_form").Click ("")

'/COLOCA A CELULA NUMA VARIAVEL
ThisWorkbook.Worksheets("Planilha1").Activate
Range("A1").Select
txt = Range("A1").Copy


obj.Window.Maximize
Application.Wait (Now + TimeValue("0:00:03"))


'.CLICA na aba pesquisa
obj.FindElementByXPath("/html/body/div[1]/div[3]/div[3]").Click ("")
obj.FindElementByXPath("/html/body/div[15]/div[1]/div[1]/div[1]/table/tbody/tr/td[1]/div[2]/input").SendKeys (ThisWorkbook.Sheets("Planilha1").Range("A1").Value)
Application.Wait (Now + TimeValue("0:00:03"))
obj.FindElementByXPath("/html/body/div[15]/div[1]/div[1]/div[2]/div[1]/table/tr[1]/td[2]").Click ("")
obj.FindElementByXPath("/html/body/div[6]/div/div[2]/form/div[1]/div[1]/table/tbody/tr/td[1]/table/tbody/tr[1]/td[3]").ClickDouble
obj.FindElementByXPath("//*[@id=""elId1340""]/div[1]/div[1]/table/tbody/tr/td[1]/table/tbody/tr[1]/td[3]").ClickContext

My doubt there is as follows. Right after opening the mouse context menu, as I do to "emulate a click" in the 'copy" submenu'

1 answer

0


I came back personal.

To pass the solution in case someone needs one day.

I managed to solve the problem with another code until very simple.

obj.FindElementByXPath("/html/body/div[15]/div[1]/div[1]/div[2]/div[1]/table/tr[1]/td[2]").Click ("")obj.FindElementByXPath("/html/body/div[6]/div/div[2]/form/div[1]/div[1]/table/tbody/tr/td[1]/table/tbody/tr[1]/td[3]").Click ("")obj.FindElementByXPath("/html/body/div[6]/div/div[2]/form/div[1]/div[1]/table/tbody/tr/td[1]/table/tbody/tr[1]/td[3]").ClickDouble'.obj.FindElementByXPath("//*[@id=""elId1340""]/div[1]/div[1]/table/tbody/tr/td[1]/table/tbody/tr[1]/td[3]").ClickContext SendKeys "^caret" + "c", True

just stopped running , "clickcontext" and swapped it for "Sendkeys " Caret" + "c", True after "clickdouble" worked right

Browser other questions tagged

You are not signed in. Login or sign up in order to post.