{"id":21201806,"url":"https://github.com/vinzh05/seleniumhelper","last_synced_at":"2025-07-10T06:32:08.845Z","repository":{"id":233772524,"uuid":"758095016","full_name":"vinzh05/SeleniumHelper","owner":"vinzh05","description":"SeleniumSupport is a robust library created to simplify and enhance your Selenium-based automation tasks. It introduces user-friendly methods and configurations to streamline browser manipulation and interaction","archived":false,"fork":false,"pushed_at":"2024-08-14T16:54:54.000Z","size":81391,"stargazers_count":16,"open_issues_count":1,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-20T02:12:32.104Z","etag":null,"topics":["csharp","selenium","selenium-csharp","selenium-webdriver"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vinzh05.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-15T16:05:49.000Z","updated_at":"2024-08-14T17:43:35.000Z","dependencies_parsed_at":"2024-08-05T19:14:46.052Z","dependency_job_id":null,"html_url":"https://github.com/vinzh05/SeleniumHelper","commit_stats":null,"previous_names":["vinzh05/seleniumhelper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinzh05%2FSeleniumHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinzh05%2FSeleniumHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinzh05%2FSeleniumHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinzh05%2FSeleniumHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinzh05","download_url":"https://codeload.github.com/vinzh05/SeleniumHelper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225622846,"owners_count":17498168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","selenium","selenium-csharp","selenium-webdriver"],"created_at":"2024-11-20T20:11:15.163Z","updated_at":"2024-11-20T20:11:15.828Z","avatar_url":"https://github.com/vinzh05.png","language":"C#","funding_links":["https://www.paypal.com/"],"categories":[],"sub_categories":[],"readme":"SeleniumSupport Library\n=======================\n\nEnhance your Selenium experience with streamlined functionality!\n\nWhat's new?\n---------------\n### *Update Version 1.1.3: In the new version 1.1.3, We have fixed a few small errors that appeared in the old version. Now you can \"Get url, Right Click, Double Click and Click a specific element among many similar elements!\n\nDownload and install to experience the new version now!\n\nDownload on nuget: https://www.nuget.org/packages/Selenium.SeleniumHelper\n\nGet the Url:\n-  get URL\n    ```csharp\n    SeleniumHelper.GetUrl(driver);\n    \n-  Right Click\n    ```csharp\n    SeleniumHelper.RightClick(driver, \"css\", \"abcxyz (Element)\");\n    \n-  Double Click\n    ```csharp\n    SeleniumHelper.DoubleClick(driver, \"css\", \"abcxyz (Element)\");\n    \n-  Click a specific element among many similar elements\n    ```csharp\n    Example: I have an element value I want to click, but on that website there are many similar elements. \n    I want to click that element specifically, for example, that element has a search number of 9. \n    I will set the ElementSpecified = 9 assignment variable.\n    \n    SeleniumHelper.clickWithElementSpecified(driver, \"css\", \"abcxyz (Element)\", 9);\n    \n### *Update Version 1.1.0: In the new version 1.1.0, We have fixed a few small errors that appeared in the old version. Now you can add preferences and use the new undetect Chrome browser!\n\nDownload and install to experience the new version now!\n\nDownload on nuget: https://www.nuget.org/packages/Selenium.SeleniumHelper\n\nFrom now everybody can add the Preference:\n\nAdd Preference guide:\n-  add Preference\n    ```csharp\n    var prefs = new Dictionary\u003cstring, object\u003e()\n    {\n        {\"credentials_enable_service\", false },\n        {\"password_manager_enabled\", false}\n    };\n    seleniumHelper.Prefs = prefs;\n    \nUse UndetectedChromeDriver Guide.\n-  UndetectedChromeDriver\n   ```csharp\n    var seleniumHelper = new SeleniumHelper();\n    var driver = SeleniumHelper.OpenUndetectChrome(seleniumHelper); //but you need to install UndetectedChromeDriver from https://github.com/fysh711426/UndetectedChromeDriver along with SeleniumHelper to avoid errors due to different versions.\n    \n### *Update Version 1.0.7 In the new version 1.0.7, you can now Screenshot the Chrome to Base64, Add BrowserPath, driverPath and Get value from ExcuteJS!\n\nDownload and install to experience the new version now!\n\nDownload on nuget: https://www.nuget.org/packages/Selenium.SeleniumHelper\n\nFrom now on when you take a selenium screenshot, it will return the result in base64 format making your image capture more convenient:\n\n- For an driver screenshot, set type to \"driver\".\n\n- For an element screenshot, set type to \"element\".\n\nScreenshot Selenium Guide.\n-  Driver screenshot\n\n   ```csharp\n   IWebDriver driver = null;\n   SeleniumHelper.TakeScreenShotToBase64(driver, \"driver\");\n\n\n- Element screenshot\n\n    ```csharp\n    IWebDriver driver = null;\n    var element = iwebdriver.FindElement(By.XPath(\"abcxyz\"));\n    SeleniumHelper.TakeScreenShotToBase64(driver, \"element\", element);\n    \n    \nAdd BrowserPath \u0026 DriverPath Selenium Guide.\n-  BrowserPath\n   ```csharp\n    seleniumHelper.UseBrowserPath = true;\n    seleniumHelper.BrowserPath = \"abcxyz\";\n\n\n- DriverPath\n    ```csharp\n    seleniumHelper.UseDriverPath = true;\n    seleniumHelper.DriverPath = \"abcxyz\";\n\n\nExcuteJS.\n- Get value from ExcuteJS\n    ```csharp\n    var height = SeleniumHelper.ExcuteJS(driver, \"return Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);\");\n    \n- Use ExcuteJS\n    ```csharp\n    SeleniumHelper.ExcuteJS(driver, \"return Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);\");\n    \n    \n### Version 1.0.3: In the new version 1.0.3, you can now add a Proxy containing authentication directly to Chrome!\n\nDownload and install to experience the new version now!\n\nDownload on nuget: https://www.nuget.org/packages/Selenium.SeleniumHelper\n\nTo configure a proxy in your settings, use the following guidelines:\n\n- For an HTTP proxy, set TypeProxy to 0.\n\n- For a SOCKS5 proxy, set TypeProxy to 1.\n\nThe proxy configuration should be specified in one of these formats:\n\n- ip:port for simple IP address and port configuration.\n\n- ip:port:user:pass if authentication with a username and password is required.\n\nMake sure to choose the correct format based on your proxy type and whether authentication is needed.\n-  Proxy have ip:port\n   ```csharp\n    seleniumHelper.TypeProxy = 0;\n    seleniumHelper.Proxyaddress = \"a:b\";\n\n\n- Proxy have ip:port:user:pass\n    ```csharp\n    seleniumHelper.TypeProxy = 0;\n    seleniumHelper.Proxyaddress = \"a:b:c:d\";\n    \nDescription\n-----------\n\nSeleniumSupport is a robust library created to simplify and enhance your Selenium-based automation tasks. It introduces user-friendly methods and configurations to streamline browser manipulation and interaction. Key features include disabling images for speed, using browser extensions, managing multiple profiles, and proxy configurations. With SeleniumSupport, developers can automate more efficiently, reducing the boilerplate code typically associated with Selenium.\n\nGetting Started\n---------------\n\n### Dependencies\n\n-   Ensure you have Selenium WebDriver installed.\n-   Compatible with major operating systems (e.g., Windows, macOS, Linux).\n\n### Installing\n\n-   Download the library from the provided repository link.\n-   Include the library in your project directory.\n-   Download on nuget https://www.nuget.org/packages/Selenium.SeleniumHelper\n\n### Executing program\n\nExecute your Selenium scripts with enhanced capabilities:\n-   Usage:\n-   \n    ```csharp\n    var helper = new SeleniumHelper();\n    var driver = SeleniumHelper.OpenBrowser(helper);\n    // Your automation code here\n\nDetailed Usage Guide\n--------------------\n### Initialize chrome\n1. `OpenBrowser(SeleniumHelper seleniumHelper)`\n\n-   Purpose: Initializes and returns a `ChromeDriver` instance configured with options specified in the `SeleniumHelper` instance.\n-   Usage:\n\n    ```csharp\n    ChromeDriver driver = null;\n    SeleniumHelper seleniumHelper = new SeleniumHelper();\n    seleniumHelper.DisableImages = false;\n    seleniumHelper.UseExtension = false;\n    seleniumHelper.UseAppMode = false;\n    seleniumHelper.ExtensionPath = \"\";\n    seleniumHelper.UseDebugPort = false;\n    seleniumHelper.DebugPort = \"\";\n    seleniumHelper.UseProfile = true;\n    seleniumHelper.ProfilePath = uidProfile;\n    seleniumHelper.ProxyType = 0;\n    seleniumHelper.ProxyAddress = \"\";\n    driver = SeleniumHelper.OpenChrome(seleniumHelper);\n\n2. `WaitElement(IWebDriver driver, string type, string element, int repeat, int timeDelay)`\n\n-   Purpose: Waits for an element to become available on the web page, retrying a specified number of times.\n-   Usage:\n\n    ```csharp\n    bool isElementFound = SeleniumHelper.WaitElement(driver, \"id\", \"submit-button\", 5, 1);\n\n3. `CheckPageSource(IWebDriver driver, int timeWait, string text)`\n\n-   Purpose: Checks if a specific text is present in the page source within a specified time period.\n-   Usage:\n\n    ```csharp\n    bool isTextFound = SeleniumHelper.CheckPageSource(driver, 3, \"Welcome\");\n\n4. `ExcuteJS(IWebDriver driver, string command)`\n\n-   Purpose: Executes JavaScript on the current page.\n-   Usage:\n\n    ```csharp\n    SeleniumHelper.ExcuteJS(driver, \"alert('Hello World');\");\n\n### Tab and Window Handling Methods\n\n1.  `OpenNewTab(IWebDriver driver)`:\n\n-   Opens a new browser tab.\n-   Example:\n\n    ```csharp\n    SeleniumHelper.OpenNewTab(driver);\n\n2.  `SwitchtoFirstTab(IWebDriver driver)`, `SwitchtoLastTab(IWebDriver driver)`, `SwitchtoCloseFirstTab(IWebDriver driver)`, `SwitchtoCloseLastTab(IWebDriver driver)`:\n\n-   Manage browser tabs by switching to or closing the first or last tab.\n-   Example:\n\n    ```csharp\n    SeleniumHelper.SwitchtoFirstTab(driver);\n    SeleniumHelper.CloseDriver(driver);\n\n### Additional Utilities\n\n1.   `AddCookieIntoChrome(IWebDriver driver, string cookie, string domain)`:\n\n-   Adds a cookie into Chrome.\n-   Example:\n\n    ```csharp\n    SeleniumHelper.AddCookieIntoChrome(driver, \"sessionId=abc123\", \"example\");\n\n2.  `GetCookieFromChrome(IWebDriver driver)`:\n-   Retrieves cookies from Chrome.\n-   Example:\n\n    ```csharp\n    string cookies = SeleniumHelper.GetCookieFromChrome(driver);\n\n\nAuthors\n-------\n\n-   BUI QUANG VINH\n-   Contact: [BUI QUANG VINH](https://www.facebook.com/Vinzh05)\n\nVersion History\n---------------\n\n-   1.0.3\n\nLicense\n-------\n\nThis project is licensed under the MIT License - see the LICENSE.md file for details.\n\nDonations\n---------\n\nSupport the ongoing development and improvement of SeleniumSupport:\n\n-   Donate via [Binance](https://www.binance.com/) Address: TRvXSzxnjDWTTi1fnouqjFvb2YNzG5RqsZ \n-   Donate via [Momo](https://momo.vn/) Address: 0974602103\n-   Donate via [Paypal](https://www.paypal.com/) Address: quangvinhb167@gmail.com\n-   Support on [Telegram](https://t.me/Vinzh05)\n-   Support on [Facebook](https://www.facebook.com/Vinzh05)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinzh05%2Fseleniumhelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinzh05%2Fseleniumhelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinzh05%2Fseleniumhelper/lists"}