Results 1 to 10 of 10

Thread: VB6 and Selenium --> SeleniumBasic ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    19

    VB6 and Selenium --> SeleniumBasic ?

    It seems the selenium can be used with VBA.


    So, can Selenium be used with VB6 ?


    https://florentbr.github.io/SeleniumBasic/

  2. #2
    Lively Member
    Join Date
    Aug 2023
    Posts
    119

    Re: VB6 and Selenium --> SeleniumBasic ?

    Yes, you can use it from VB6, I have some projects that work with it. If you want some sample code just let me know. I use also Google Chrome so you need the wrapper and the Chromedriver for your Chrome version (https://googlechromelabs.github.io/chrome-for-testing/)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    19

    Re: VB6 and Selenium --> SeleniumBasic ?

    Quote Originally Posted by zx81sp View Post
    Yes, you can use it from VB6, I have some projects that work with it. If you want some sample code just let me know. I use also Google Chrome so you need the wrapper and the Chromedriver for your Chrome version (https://googlechromelabs.github.io/chrome-for-testing/)

    Yes, please ! can you post it here ?

    I installed SeleniumBasic Yesterday, but for me a simple task to open a webpage resulted in a error, something as Class not registered !
    Last edited by AngeloGomes; Feb 28th, 2024 at 01:16 PM.

  4. #4
    Lively Member
    Join Date
    Aug 2023
    Posts
    119

    Re: VB6 and Selenium --> SeleniumBasic ?

    First of all you need to install Selenium wrapper and the chrome driver I've posted (choose the right version for your Chrome).

    You must add to your project the references for "Selenium Type Library" (under Project->References)

    And try a code like this:

    Code:
    Dim Chrome As new WebDriver
    Dim By As new Selenium.By
    Chrome.Get "https://www.yourpage.com"
    'for example you can look for a button css
    If Chrome.IsElementPresent(By.Css("button.btn.btn-secondary")) Then
    'do something
    End If
    ...

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    19

    Re: VB6 and Selenium --> SeleniumBasic ?

    Quote Originally Posted by zx81sp View Post
    First of all you need to install Selenium wrapper and the chrome driver I've posted (choose the right version for your Chrome).

    ...[/CODE]

    The Chromedriver is ok, but the Selenium Wrapper: which one do you use ?

  6. #6
    Lively Member
    Join Date
    Aug 2023
    Posts
    119

    Re: VB6 and Selenium --> SeleniumBasic ?

    Quote Originally Posted by AngeloGomes View Post
    The Chromedriver is ok, but the Selenium Wrapper: which one do you use ?
    The wrapper is the one you posted in your first post.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    19

    Re: VB6 and Selenium --> SeleniumBasic ?

    Hi zx81sp

    Thank you.

    I could run the code now.


    I´ve also found an updated version for the wrapper see
    SeleniumBasic 3.141.0.0


    https://www.cnblogs.com/ryueifu-VBA/p/13661128.html



    Now I am facing some problems to trap errors. If Selenium gets an error, the vb code stops to run and display a message by default, The line "On Error Goto" does not work for this


    Name:  error.jpg
Views: 674
Size:  20.2 KB
    Last edited by AngeloGomes; Mar 7th, 2024 at 02:31 PM.

  8. #8
    PowerPoster
    Join Date
    Jan 2020
    Posts
    5,044

    Re: VB6 and Selenium --> SeleniumBasic ?

    Quote Originally Posted by AngeloGomes View Post
    It seems the selenium can be used with VBA.


    So, can Selenium be used with VB6 ?


    https://florentbr.github.io/SeleniumBasic/
    it,'s SeleniumBasic2.0Open source has the source code.But after I recompile, it will also cause frequent crashes and can not be registered for use.
    how to use it without register dll,setup?

    Selenium Basic 3.141, which has a lot of compatibility issues and often fails to install and use.

  9. #9
    PowerPoster
    Join Date
    Jan 2020
    Posts
    5,044

    Re: VB6 and Selenium --> SeleniumBasic ?

    The perfect way is to use a web socket connection yourself. The chrome debugging protocol, which does not require any SeleniumBasic wrappers, is the fastest and most stable,

  10. #10
    Lively Member
    Join Date
    Aug 2023
    Posts
    119

    Re: VB6 and Selenium --> SeleniumBasic ?

    Quote Originally Posted by AngeloGomes View Post
    Hi zx81sp

    Thank you.

    I could run the code now.


    I´ve also found an updated version for the wrapper see
    SeleniumBasic 3.141.0.0


    https://www.cnblogs.com/ryueifu-VBA/p/13661128.html



    Now I am facing some problems to trap errors. If Selenium gets an error, the vb code stops to run and display a message by default, The line "On Error Goto" does not work for this


    Name:  error.jpg
Views: 674
Size:  20.2 KB
    I use the older wrapper and since it works fine I never tried to find an updated one.

    I don't have errors with the wrapper but will take a look forcing one and will see if it can be controlled.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width