New answers tagged

0

You could likely achieve this through Inheritance, by having all of your test classes inherit from a single class (this would presumably be Reporting). To achieve this, something like: public class TestDashboardModule : Reporting { [Test] public void TestThird() { // test code } [Test] public void TestFourth() { /...


0

Hi css selector does not support using contained text as a identifier : https://www.w3.org/TR/selectors-3/#content-selectors you could use xpath to find element using text In your case , all your css locators are incorrect: the tag you are using is button and not input, so it should start with input There is no attribute called "type" in your given ...


1

You can check the filesystem for the downloaded file: private boolean isFileDownloaded(String downloadPath, String fileName){ boolean flag = false; File dir = new File(downloadPath); File[] dirContent = dir.listFiles(); assert dirContent != null; for(File file : dirContent){ if (file.getName().equals(fileName)) { return flag = ...


0

The process of downloading a file is a browser activity regarding HTTP requests and the file system. So Selenium is not the appropriated tool, because its concern is limited to the DOM. Selenium would fit the point of clicking the button. If your goal is to check the browser itself, you should use unit and integration checks. If your goal is to check the ...


0

Selecting by visible text is only possible via xpath. That being said you can use the class selectors provided above, or create a more specific one, using the onclick parameter, i.e. : By.CssSelector("button[onclick='new UserManagement().LoadExcelExportSearchResult();']") If you want to stick with text, you need to capture all button elements and iterate a ...


0

Driver.FindElement(By.CssSelector("button[class*=buttondefault]")); using wildcard selector (*) which means if the class attribute has this proprety at any place it will find this element or Driver.FindElement(By.CssSelector("button[class^=buttondefault]")); using caveat selector to find elements starting with "buttondefault" attribute or Driver.FindElement(...


1

So, I ended up using FluentAssertion for assertions. FluentAssertion has this feature built-in.


2

use Assert.That(User.HasProducts, Is.True, "I am failed because User.HasProducts not true") You will see the message I am failed because User.HasProducts not true if the test failed on this assert.


1

I'll consider XPath. It seems you'd need to use text() as well: //span[@class="filtervalue" and contains(text(), "Search")] You don't need to use contains(), you can use just text()=, but it seems to me that the text value might change, so contains() might apply even after the change.


1

If you were not explicitly quitting the driver before and you are not doing that now as well then the change could be because of the change in below two areas Probably something in the logic of how you start/quit your driver and/or tests. Probably the change could be in the behavior of the application being tested. In my experience the issue you are ...


1

I could not interact with the checkbox using click(), but could send the space key to the input element. For example: driver.FindElement(by).SendKeys(Keys.Space)


0

I agree that you don't need Selenium. Instead of a Page Object Pattern, you want to model your request and response objects as classes. RestSharp has dependencies on JSON serializer and deserializer classes, so you set up things like Customer customer = response.Convert<CustomerResponseObject>();, and your object hold the object structure. João's ...


1

You seem good to go with some service testing. NUnit -> I want to use parallel test methods execution/calling with Priorities using C# similar to TestNG in Java. //Arrange //Act //Assert or //SetUp //Act //Assert //TearDown Both ideas are actually the same. Arrange is a Setup + Teardown. Specflow -> Gherkin ...


0

With chrome the setup is a little different. I'd need more info to help. Were you able to connect before and it recently stopped? If so I would say to make sure you have the most up to date driver. Is this the initial setup?


Top 50 recent answers are included