ChromeDriver - WebDriver for Chrome

Post Reply
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

ChromeDriver - WebDriver for Chrome

Post by Horizon »

Hi,

Is there anybody to use it from harbour?

Thanks.
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: ChromeDriver - WebDriver for Chrome

Post by Horizon »

Hi,

We have to download chromedriver from https://chromedriver.chromium.org/downloads and copy it to pathed directory.
(https://chromedriver.chromium.org/getting-started)

To use it, We should download Selenium webdriver from https://www.selenium.dev/downloads/.

Next step is that run chromedriver using selenium webdriver and open any web site from application.
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: ChromeDriver - WebDriver for Chrome

Post by Horizon »

Hi,

In order to test Selenium library. I have installed Visual Studio 2019 using C# by using this link https://testguild.com/selenium-webdriver-visual-studio/.

This is the latest C# code.

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;

namespace mySelenium
{
    class Program
    {
        static void Main(string[] args)
        {
            //!Make sure to add the path to where you extracting the chromedriver.exe:
            IWebDriver driver = new ChromeDriver(@"C:\WebDriver\bin"); //<-Add your path
            driver.Navigate().GoToUrl("http://forums.fivetechsupport.com/viewforum.php?f=3");

//            IWebElement myField = driver.FindElement(By.Id("btn red-flamingo"));
//            IWebElement myField = driver.FindElement(By.ClassName("red-flamingo"));
//            myField.Click();

//            myField = driver.FindElement(By.Name("tridField"));
//            myField.SendKeys("3333");

//            myField = driver.FindElement(By.Name("egpField"));
//            myField.SendKeys("4444");

            
//            myField = driver.FindElement(By.ClassName("submitButton"));
//            myField.Click();

 
            Thread.Sleep(15000);
            driver.Quit();
        }
    }
}
 
This code is opens a new chrome browser page and sleep 15 second than close it.

Next step, Can anyone help me to call it from Harbour?

Thanks.
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: ChromeDriver - WebDriver for Chrome

Post by Horizon »

Hi,

I build test project in c# msvc 2019. in the build folder, there is a Webdriver.dll file.

How to create lib file from this dll?
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
Post Reply