Ramco Ramco

Ramco Ramco

  • 443
  • 3.4k
  • 527.1k

How the Code Works

Apr 3 2024 8:23 AM

Hi

  What the below code means. What is OpenQA.Selenium. Is it free . Can i add reference in my App

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Support.UI;

namespace YoutubeTools;

public partial class FrmMain : Form
{
    const string BASE_URL = "youtube.com/watch";
    const string XPATH_PLAY = "//button[contains(@class, 'ytp-play-button ytp-button') and @data-title-no-tooltip='Play']";
    const string XPATH_MUTE = "//button[contains(@class, 'ytp-mute-button ytp-button')]";
    const string XPATH_TIME = "//span[@class = 'ytp-time-duration']";

    readonly Random _random;
    bool _isRunning;
    TimeSpan _duration;
    IWebDriver _driver;

Thanks


Answers (2)