Hi guys i am trying to click an element in a frame but i cannot switch to the said frame. I tried everything but i get either :there is no such element or no such frame error.HTML below
VBA Code:
Option Explicit
Public Sub test()
Dim pause1, pause2, pause3, url, url2 As String
pause1 = "00:00:08"
pause2 = "00:00:30"
pause3 = "00:00:40"
url = "http://tra01:1000/"
url2 = "https://TDMLogon.jsp"
Dim driver As New WebDriver
Dim rowc, cc, columnC As Integer
Dim tblent As Variant
Dim By As selenium.By
Set By = New selenium.By
driver.Start "Chrome"
driver.Get (url2)
Application.Wait Now + TimeValue(pause3)
driver.FindElementByXPath("/html/body/table[2]/tbody/tr/td/table[1]/tbody/tr/td/form/table/tbody/tr[2]/td/table/tbody/tr[1]/td[2]/select").AsSelect.SelectByText ("EMP ID")
driver.FindElementByXPath("/html/body/table[2]/tbody/tr/td/table[1]/tbody/tr/td/form/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/select").AsSelect.SelectByText ("English")
driver.FindElementByXPath("/html/body/table[2]/tbody/tr/td/table[1]/tbody/tr/td/form/table/tbody/tr[2]/td/table/tbody/tr[4]/td/input").Click
Application.Wait Now + TimeValue(pause1)
driver.SwitchToParentFrame
driver.SwitchToFrame driver.FindElementByXPath("//*[@id=""frameset2""]")
Application.Wait Now + TimeValue(pause1)
driver.FindElementByXPath("//*[@id=""homeSearch""]").Click
End Sub