Questions tagged [c#]

Use for questions about testing using C#. This can include unit tests, integration tests, UI tests. If a programmed test uses C#, and the question relates to testing rather than to code, the C# tag should be used.

1
vote
2answers
1k views

Running Web and Application Automated Tests from the same Framework

I am writing automated tests for my company, and I am doing so from the ground up. We provide both desktop and web applications to our clients. After doing a lot of research and testing, I landed on ...
1
vote
1answer
78 views

TFS Selenium C# Visual Studio 2017

I have recently joined a company and they use TFS. I am an automated tester so I have setup MS Unit framework, selenium and c# within VS2017. I am comfortable in doing this standalone because its ...
1
vote
2answers
91 views

Selenium Webdriver - handling error messages that are shown to user

I've made an automated test case that creates a user inside an app. It's pretty simple, the test enter username, email, password and presses OK. But how should I handle scenarios if user enters an ...
1
vote
2answers
72 views

Issue with find element

I am using Selenium v3.8.0, also I do the coding in C#. Now I try to validate if XPath or the webElement exists on the site, though I don't success Now I try to validate the text Login then I want ...
1
vote
2answers
64 views

Can we consider the work stoppage of a sub function as critical issue?

I'm testing a tool i.e. Draw tool. The tool enables the user to draw on a map using the available graphics and to export drawing from local disk. The user is able to draw, but export drawing sub ...
1
vote
1answer
58 views

Getting error while adding Test annotation in project using NUnit

I encountered with some errors when tried to add the NUnit Annotation to my code as shown in below image. I have done some error research from Here and here also following instructions from here too ...
1
vote
2answers
3k views

how to find int value within span class Selenium C#

The int value inside the bold span class is a count of results, which will vary. I want to find it so I can validate it against a database get. <span class="baseline float-left blocking-rule-...
1
vote
2answers
100 views

Quickest way to get ID and Name of all fields in single go

Currently, I am using the traditional way i.e. 'Inspect Element' (or Firebug or IE Developer) for getting value of ID and Name attributes of any field present over page for which I am creating test ...
1
vote
2answers
98 views

Can not find getPageSource method in visual studio 2017

I am using Visual Studio 2017 and found that class ChromeDriver does not contains method getPageSource(). Does anybody knows why? using System; using System.IO; using OpenQA.Selenium.Chrome; ...
1
vote
1answer
250 views

How to find IWebElement in other IWebElement with Selenium Web?

I'm trying to get some IWebElement in other specific IWebElement which I find, but it doesn't work. Here I find all of the repeated HTML blocks, it works OK: List<IWebElement> ...
1
vote
1answer
59 views

(C#) Selenium: How do I choose an option within a ComboBox?

How do I select the "C" option of my ComboBox "opcao_pesquisa"? <form name="Form1" method="post"> <input type="hidden" name="operacao" value="1"> <input type="hidden" name="d" ...
1
vote
1answer
349 views

Unable to select element when element is in span than select Selenium c#

I am trying to select an element from dropdown with text as Ad. My page has a telerik dropdown and this is the HTML Code. I am running following code: SelectElement IDdropdown = new SelectElement(...
1
vote
4answers
175 views

Unable to locate the element using Xpath selenium C#

How can I get the highlighted value using Selenium C#?
1
vote
2answers
53 views

Launching Mozilla Firefox Browser

I am trying to launch this browser & the code worked previously: namespace AutoFramework { using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using System; public static class ...
1
vote
2answers
741 views

Selenium Test Suite fails to execute in Jenkins but works correctly on local machine

I have been struggling with this issue for some time and maybe someone from here has come across it and might provide me with any suggestions or solutions. I have a fully working Test Framework with ...
1
vote
2answers
3k views

How to verify icon state using Selenium?

How to verify that icon is not displayed or icon is displayed on the page ? Image: Here it is html code if icon is not displayed: <td id="messageGrid_tccell1_7" class="txtleft dxgv"/> Here ...
1
vote
1answer
2k views

How to bypass basic authentication in Safari 10 with Selenium?

I have been researching about how to bypass browser authentication in Safari 10 (or Chrome) in Mac OS Sierra. I have tried the following: http://username:password@URLofAPP I have also tried: alert....
1
vote
2answers
203 views

Questions Regarding POM Framework

I am developing a framework for the popular e-commerce trading website platform (Amazon) – from scratch. I will be starting a new automation testing role, and, I need to get more practice before I ...
1
vote
1answer
5k views

Selenium C# [FindsBy] attribute Search for an element again

When I navigate to my page under test, at the beginning of the entire Page Object class initialization certain elements are not visible, but they become visible when I click on drop down (which is not ...
1
vote
1answer
565 views

Selecting An Item From A Drop Down List

I am trying to select an item from a drop down list. I have put the code in the section below. My research has not been conclusive though: https://stackoverflow.com/questions/5278281/how-to-select-an-...
1
vote
1answer
668 views

Unable to take screenshots on RemoteWebDriver - running tests thru Selenium Grid

I am running my selenium test thru Selenium Grid and I couldn't take screenshot on the node from my hub. I have followed the code from the Selenium HQ: public class ScreenShotRemoteWebDriver : ...
1
vote
2answers
959 views

Working with List<webdriver> java and c#

In c# i always use `IList<IWebElement> SearchResult1 = Setup.driver.FindElements(By.CssSelector("div.comma.line"));` and i access the SearchResult1 by SearchResult1[0] or SearchResult1 []. ...
1
vote
1answer
991 views

Running Appium test on a MAC with c#

Im little bit good at c# and not at JAVA , So is there any way to write Appium scripts on a MAC using c# ? My target is to make some automation scripts to test an android and iOS build which ...
1
vote
2answers
690 views

How to run selenium Webdriver test cases in Firefox C#?

TestFixture: class TestForFirefox { IWebDriver driver = null; [SetUp] public void Initialize() { this.driver = new FirefoxDriver(); } [Test] public void ...
1
vote
2answers
386 views

Page object practices

I am building a testing framework for a website using Page Object Model with Selenium I am thinking that in general if I have two pages with the exact user controls and functions but different URLs I ...
1
vote
1answer
198 views

Compiler Error: cannot convert from 'X' to 'Ranorex.Core.Testing.ITestModule'

We have implemented a test and some helper classes in the same file. When trying to run the test, we get a compiler error stating: Compile Error: Argument 1: cannot convert from 'X' to 'Ranorex....
1
vote
2answers
589 views

Why is explicit waits flaky?

I have my code below: IWebElement elem = null; WebDriverWait wait = new WebDriverWait(DriverContext.Driver, TimeSpan.FromSeconds(20)); elem = wait.Until(ExpectedConditions....
1
vote
1answer
67 views

Testing Different User Setting's Effects On a Page

I am using Microsoft Visual Studio and Selenium to test a webpage. This particular website requires a user to login to the web page and based on some settings, some elements will be displayed and some ...
1
vote
1answer
915 views

How to count rows in GridView using webdriver c#, how to translate the existing protractor script to c# webdriver

I am trying to count the rows of the table and below is the HTML: I want to get the total count rows of the table, discarding table header and expanded row. I had tried the code below: var ...
1
vote
2answers
91 views

Software to Build a Selenium POM

I have a basic script that parses through HTML and creates a basic POM based on Inputs, Selects etc. It does a decent job but I was curious if there is any 'professional' or popularly used pieces that ...
1
vote
1answer
96 views

Selenium: source code for the different locator types?

So, I've been wanting to take a look at the dotNet code for the different locator strategies (Id, ClassName, XPath, TagName, ...). In the By class, I've found this for Id: by.findElementMethod = (...
1
vote
2answers
6k views

How to verify PDFs with Selenium web driver

In our application, we upload PDF's into an interface. In this interface, the PDF is just a property of an object in a row that is displayed for the end user. The end user can see if a PDF has been ...
1
vote
1answer
1k views

How to read value from XML [closed]

I know this is a common question, but I have a requirement where I need to read values from XML file. Sturcture of the XML file is <?xml version="1.0" encoding="utf-8" ?> <root> <...
1
vote
3answers
37k views

Selenium: Select 2nd item by both class and with certain text?

I am creating some test scripts using Selenium WebDriver in C#. The AUT contains a left menu in which the position/ordering of the links depend upon the 'User Preferences' and a lot of factors/...
1
vote
2answers
13k views

Cannot access elements in iframe

I cannot access elements inside of an iframe, I have tried the call: IWebElement iframeSwitch = driver.FindElement(By.XPath("//iframe[contains(@id, 'contentIFrame1')and contains (@title, 'Content ...
1
vote
2answers
5k views

Can I use Eclipse for .Net application with Selenium jars?

My application is developed using .Net and now I need to automate this application using Selenium. So, please guide me which Selenium jar and IDE I have to use to do automation. I know, for Java ...
1
vote
1answer
9k views

Selenium framework using C# and excel

I am new to automation (Selenium ). I am working as manual tester and recently got a task related to selenium automation. I have basic knowledge of selenium and very good knowledge of C#. I can ...
1
vote
1answer
1k views

Wrap specflow scenario within try-catch

I have been running into a problem with the C# selenium bindings decribed here: https://stackoverflow.com/questions/22322596/ where a timeout exception is thrown occasionally while running my ...
1
vote
3answers
5k views

Disable a pop up rendered in FF and not with IE

when testing with Selenium Webdriver, I'm getting an advertising pop up window with Firefox and not with IE. Actually this pop up is preventing me from doing many other tasks. Is there a way to ...
1
vote
3answers
5k views

Automated Test With Image Comparison

I have a WPF application and I have a custom object (the output) with images and text. I need to check if the output has a correct format. I tried with Coded UI but, because the element is a custom ...
1
vote
1answer
715 views

How to save compiled document on Desktop using C# Selenium

Using Selenium WebDriver with C# in VS 2010, I compiled a document using automation and then I want to save the file on my desktop. During automation a new window is popping up to "save or open file". ...
1
vote
2answers
55 views

In a Webdriver UI test, do you have to check for the existence of every element you use?

I'm working on my first Selenium/Webdriver tests, and I have a rather basic question. I was thinking of adding a login helper method, since it's going to be a rather basic feature of every test. I ...
1
vote
1answer
41 views

How to update C# version in Ranorex Studio?

My project in Ranorex Studio (v8.3.1) is using .NET Framework 4.5.2 and C# 5.0. I want to leverage the features of newer C# versions e.g. String Interpolation. So I want to upgrade my Ranorex Project ...
1
vote
1answer
191 views

Deviation in JMeter

I am new to Web API development. I have created a small Web API, which returns a JSON output. The Web API is running on another PC in the same network. I have been connected to the API via GET ...
1
vote
1answer
611 views

How to compare string value with integer in Selenium [closed]

I'm getting the text as string and i need to compare it with a number, If its grater than that number then execute an if statement and if not then else. I'm using following code : string sato = ...
1
vote
1answer
40 views

How to test API contracts when there is a dependency on data from an outside source

I'm after some advice regarding a project I am currently working on. There is a front-end, similar to what Amazon is like in that sales are fed through the site(there is no API for doing this). ...
1
vote
1answer
48 views

How to navigate to a “Not Secured” web page using PhantomJS

I was trying to navigate to a web page which is not secured. When I try to do this using PhantomJS, it's not navigating the web page. I can see that by debugging the code. So, how should I navigate ...
1
vote
2answers
100 views

Advice on assertions to make when creating an API testing framework

I'm currently looking at building an API test automation framework for a series of Rest Services, utilising c#. Coming from a UI-automation background I was after some advise on assertions when ...
1
vote
1answer
694 views

Dll file is missing in my Debug folder (C#-Selenium)

I am trying to run my Automated test cases from the command line. My tests were written in C# - NUnit-Selenium-Webdriver. I opened my solution in file explorer then navigated to Bin--> Debug, but I ...
1
vote
1answer
1k views

How to fail NUnit test by default (I want to call Assert.Pass when it should pass)

I have medium level experience on unit testing and now I'm learning about NUnit. As far as I can see, a NUnit test passes by default if you don't call Assert.Fail method. In my test case, I want it ...