ChromeDriver - WebDriver for Chrome
ChromeDriver - WebDriver for Chrome
Hi,
Is there anybody to use it from harbour?
Thanks.
Is there anybody to use it from harbour?
Thanks.
Regards,
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
Re: ChromeDriver - WebDriver for Chrome
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.
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 & MSVC 2022 & FWH 23.04
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
Re: ChromeDriver - WebDriver for Chrome
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.
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.
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 | Expand
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 & MSVC 2022 & FWH 23.04
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
Re: ChromeDriver - WebDriver for Chrome
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?
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 & MSVC 2022 & FWH 23.04
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
Re: ChromeDriver - WebDriver for Chrome
Was there any progress on this ?
There is also a Selenium based browser automation framework for VB.Net, VBA and VBScript
https://florentbr.github.io/SeleniumBasic/
I believe that, If SeleniumBasic can be used via VBScript then it should be possible with Fivewin too.
This is a handy tool for Web browser automation. For eg. Programmatically you can log in to a website, fill in the username and password via our Fivewin, then search for specific data, fetch the data from the HTML table to Excel etc all these processes can be done in an automated manner.
Has anybody here already done this using SeleniumBasic ?
Here is the link to download the tool
https://github.com/florentbr/SeleniumBa ... g/v2.0.9.0
They have provided the source codes too but it is in C#
There is also a Selenium based browser automation framework for VB.Net, VBA and VBScript
https://florentbr.github.io/SeleniumBasic/
I believe that, If SeleniumBasic can be used via VBScript then it should be possible with Fivewin too.
This is a handy tool for Web browser automation. For eg. Programmatically you can log in to a website, fill in the username and password via our Fivewin, then search for specific data, fetch the data from the HTML table to Excel etc all these processes can be done in an automated manner.
Has anybody here already done this using SeleniumBasic ?
Here is the link to download the tool
https://github.com/florentbr/SeleniumBa ... g/v2.0.9.0
They have provided the source codes too but it is in C#
Re: ChromeDriver - WebDriver for Chrome
I tried to create a Lib from the DLL using implib. Unfortunately, the size of the created lib is just 1 KB. Is that normal. ?
While trying to do the implib this is the message that I got
![Image](https://i.postimg.cc/qB2Th15t/Selenium-Basic.jpg)
While trying to do the implib this is the message that I got
Code: Select all | Expand
D:\bcc7\bin\implib -a Selenium.lib Selenium.dll
Embarcadero Implib Version 3.3.0 Copyright (c) 1991-2014 Embarcadero Technologies, Inc.
Warning Selenium.dll: no exports
![Image](https://i.postimg.cc/qB2Th15t/Selenium-Basic.jpg)
- Antonio Linares
- Site Admin
- Posts: 42520
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Re: ChromeDriver - WebDriver for Chrome
Dear Anser,
It seems as it is a .NET DLL.
You can use FWH WebView to do Web browser automation.
Please review FWH\samples\webviewuni.prg
It seems as it is a .NET DLL.
You can use FWH WebView to do Web browser automation.
Please review FWH\samples\webviewuni.prg
Re: ChromeDriver - WebDriver for Chrome
OK. Thank you ![Smile :)](./images/smilies/icon_smile.gif)
I thought that something that can be accessed via VBA or VBScript can be used by Harbour too
A COM library to use Selenium with Excel in the Visual Basic Editor or within a visual basic script (VBS). That's what they have mentioned.
This Selenium has extensive inbuilt features, for eg to export HTML tables to Excel etc.
![Image](https://i.postimg.cc/VNX7c9P3/Screenshot-2023-01-19-144823.jpg)
I assumed that the failure was because I have not static linked the DLL
The same code in Vbscript is working ie
![Smile :)](./images/smilies/icon_smile.gif)
I thought that something that can be accessed via VBA or VBScript can be used by Harbour too
A COM library to use Selenium with Excel in the Visual Basic Editor or within a visual basic script (VBS). That's what they have mentioned.
This Selenium has extensive inbuilt features, for eg to export HTML tables to Excel etc.
Code: Select all | Expand
Function TestSelenium()
Local oSel, oPost, aData:={}
oSel := CreateObject("Selenium.ChromeDriver")
oSel:Start("chrome")
Sleep(500)
// Works fine till here. It opens Chrome with a label "The Chrome is being controlled by automated test software"
// next it has to open the website. As per the documentation
// we should call Get("URL")
// Fails at the next line. Says no exported method https://www.google.co.in
oSel:Get( "https://www.google.co.in" ) // Fails here a
oSel:Quit()
Return
![Image](https://i.postimg.cc/VNX7c9P3/Screenshot-2023-01-19-144823.jpg)
I assumed that the failure was because I have not static linked the DLL
The same code in Vbscript is working ie
Code: Select all | Expand
Set oSel = CreateObject("Selenium.ChromeDriver")
oSel.Get "https://accounts.google.com/ServiceLogin"
oSel.FindElementById("identifierId").SendKeys "MyEmailId@gmail.com"
Shall try that.Antonio Linares wrote: You can use FWH WebView to do Web browser automation.
Re: ChromeDriver - WebDriver for Chrome
hi,
to use DotNet DLL you need to make a "C-Wrapper" using iDispatch Interface
here a Sample which i have used under Xbase++
compile with MSVC call
on Xbase++ Side
to use DotNet DLL you need to make a "C-Wrapper" using iDispatch Interface
here a Sample which i have used under Xbase++
Code: Select all | Expand
// sample from http://www.codeproject.com/dotnet/nettocom.asp
using System;
using System.Runtime.InteropServices;
namespace Tester
{
[Guid("D6F88E95-8A27-4ae6-B6DE-0542A0FC7039")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface _Numbers
{
[DispId(1)]
int GetDay();
[DispId(2)]
int GetMonth();
[DispId(3)]
int GetYear();
[DispId(4)]
int DayOfYear();
}
[Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Tester.Numbers")]
public class Numbers : _Numbers
{
public Numbers(){}
public int GetDay()
{
return(DateTime.Today.Day);
}
public int GetMonth()
{
return(DateTime.Today.Month);
}
public int GetYear()
{
return(DateTime.Today.Year);
}
public int DayOfYear()
{
return(DateTime.Now.DayOfYear);
}
}
}
Code: Select all | Expand
regasm test.dll /unregister
csc /t:library test.cs
::csc /t:library /debug:full /debug+ %1.cs
regasm test.dll
Code: Select all | Expand
#pragma library( "ascom10.lib" ) // Xbase++ LIB for ActiveX
proc main()
local oAX
oAX := CreateObject("Tester.Numbers")
? oAX:getDay()
return
greeting,
Jimmy
Jimmy
Re: ChromeDriver - WebDriver for Chrome
Thank you for this information ![Smile :)](./images/smilies/icon_smile.gif)
This opens a lot of possibilities for integration with Fivewin/Harbour.
![Smile :)](./images/smilies/icon_smile.gif)
This opens a lot of possibilities for integration with Fivewin/Harbour.