Hi guys, I am going to run a test mobile emulator with selenium and VS C#
Import
using System;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.Chrome;
Driver Utils Class
First of all delclaring the webdriver, which will be used for open specfic browser
namespace SeleniumAutomation
{
[TestClass]
public class Setup
{
IWebDriver webDriver;
}
}
Open Chrome
[Test]
public void Open_Browser()
{
webDriver = new ChromeDriver();
}
Open Chrome Mobile Emulator
[Test]
public void Mobile_Emulator_Browser()
{
ChromeOptions chromeCapabilities = new ChromeOptions();
chromeCapabilities.EnableMobileEmulation("Pixel 5");
webDriver = new ChromeDriver(chromeCapabilities);
}
I think it will be helpful to run chrome in mobile emulator