1

I am new to VBA and Macros on Excel. I am trying to locate elements on a webpage on Microsoft Edge using the FindElementById but it does not seem to be working. In my code

    Private obj As Selenium.EdgeDriver

    Sub DeniosAuto()

    Set obj = New Selenium.EdgeDriver
    
    obj.Start
    obj.Get "https://denios.rico.robiotic.com/authenticate"
    
    Dim FindBy As New Selenium.By
    Debug.Print "Email present " & obj.IsElementPresent(FindBy.ID("2-email"))
    
    'Interact with Email and Password Fields
    '#\32 -email
    Dim SearchInput As Selenium.WebElement
    Set SearchInput = obj.FindElementById("2-email")

    SearchInput.Click
    
    Debug.Print "Email present " & obj.IsElementPresent(FindBy.ID("2-email"))
   
    'obj.FindElementByName("email").SendKeys ("mohamed.aly@cht.com")


    End Sub

the error occurs in the line SearchInput.Click. I am trying to fill in a form that has an email and password to be able to login but the items on this page can not be identified to interact with. You can find the HTML here

[enter image description here][]

Thanks in advance

Raymond Wu
  • 3,357
  • 2
  • 7
  • 20
  • You need to add the first two images as text to your post. Also, you need to explain what you want to do with the data and in which line the error occures. – VBasic2008 Feb 14 '22 at 18:52
  • Done :). Awaiting my question to be reopened. Thanks. – Mohamed Aly Feb 15 '22 at 06:35
  • Please do not paste your code as image, you can easily copy and paste the code into the question as a code block. (same for the HTML). Have you checked the answer provided above to see if it works? @MohamedAly – Raymond Wu Feb 15 '22 at 06:37
  • Hello Raymon, i have tried the answer provided above but I can not locate the elements on this particular page. My code works on other websites such as Wikipedia or Google. The items on this web page are not detectable. I am not sure if there is a way to make them detectable. – Mohamed Aly Feb 16 '22 at 06:21
  • @MohamedAly In that case, you need to provide more HTML code, the element could be hidden behind an `iframe` element but without details, it's all wild guesses. Note, you need to `@[username]` someone if the comment is intended for an individual so that they can receive a notification. – Raymond Wu Feb 16 '22 at 07:51
  • @RaymondWu I have been trying to play around and find another case to use which identifies the element but I could not be able to find any. I have also edited the post as recommended. I would appreciate it if you could have a look at it if you got the time :). Thank you for your help. – Mohamed Aly Feb 17 '22 at 09:00
  • Have a look at this code https://pastebin.com/PqZfkpYD – YasserKhalil Feb 17 '22 at 10:04

0 Answers0