Closed ganesanviji closed 5 years ago
@ganesanviji NUnit doesn't have any built-in functionality to open web pages or load URLs. That is normally done with your own code or with a third-party framework like Selenium. Can you give us more information on what you are using to test in-browser so that we can direct you to the resources you need?
Hi @rprouse
Yes, I am using the selenium for launch the localhost URL and I have given the testing assembly which is compiling by the below mentioned code as a parameter for the Nunit console exe. In below code I am using the Firebox browser which is supported only in 43 version. I have tried Chrome browser but localhost link is not open in that browser.
[TestFixture("Firefox")] [ImageComparison(true)] public class Test : NUnitUtil { private string activeBrowser; private string SampleURL = "http://localhost:5000";
public Test(string browser)
{
driver = GetWebDriverForBrowser(browser);
activeBrowser = browser;
}
[TestFixtureTearDown]
public void quitDriver()
{
driver.Quit();
}
[Test, Description("Control rendering")]
[Category("Basic")]
public void AngularCDNmaterial30()
{
driver.Navigate().GoToUrl(SampleURL);
IWebElement element = driver.FindElement(By.TagName("body"));
Thread.Sleep(15000);
TakeAndCompareScreenshot(element);
}
}
Please suggest the solution for this
Thanks, Ganesan R.
The call GetWebDriverForBrowser
and the various methods on the driver
variable are nothing to do with NUnit, nor is the NUnitUtil
base class that you are using. That is all Selenium code, not NUnit. You will need to report the issue there.
Hi @rprouse
Okay. Thanks
Hi,
I am using nunit console for test my ASP.NET Core web blazor application. But when run the local host of my application by using nunit I have faced the below issue like the localhost url is not open in latest firefox. Could you please update the details why Nunit does not support the latest version and work around for this issue.
Note: Nunit is working in 43 version firefox. But blazor application is only running in latest version of firefox. So, could you please suggest me how can I run the nunit in latest firefox.
Thanks. Ganesan R.