Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c#]

C# is a multi-paradigm programming language developed by Microsoft.

0
votes
1answer
16 views

Sequential Webdriver Testing with Selenium C# Testing

I would like to create a set(more than two) of Selenium C# [TestClass] which are structured in a way that would run on a single WebDriver object. Is it possible to possible to have an object lifetime ...
0
votes
2answers
20 views

Sharing static class variables data between two Selenium classes c#

I have two Selenium C# test case classes, ClassA and ClassB. I would like to reuse a static variable VarA, defined in another static non-test ClassC. After ClassA has made a change to the variable, I ...
0
votes
1answer
30 views

Unable to locate a search suggestion element Selenium C#

Hi, I am trying to locate and click on the element that comes up in the search box when I type some name. Can someone please help me out to find & click on the name? I've use searching by XPath - ...
-1
votes
2answers
30 views

WebDriver: How do I use 'IF STATEMENT…' while making a dropdown select with C#

I am new with Selenium. I have a dropdown field that will always have something selected and I am looking for a way to say if I run a test and the dropdown selected a value, next time I run a test I ...
0
votes
1answer
20 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
votes
0answers
13 views

Test different scenarios in ASP.NET MVC5 Apps

I want to add Selenium tests for testing my UI. First test that I want to create is following: When Selenium driver turns on my application I want to scenarios. 1. Redirect to my login page (if user ...
1
vote
4answers
54 views

Unable to locate the element using Xpath selenium C#

How can I get the highlighted value using Selenium C#?
0
votes
1answer
37 views

Before entering entire text completely, Selenium is saving data

There is a form having only two field name and Code. Code validation criteria is minimum 2 and max six character. As soon as you enter 2 character save button become enable. Now, problem is when ...
0
votes
1answer
50 views

Selenium, data driven testing using NUnit and SQL queries.

I am developing a Selenium Test Automation Framework for the purpose of testing multiple websites. I have currently set up the Framework in Visual Studio using C# and implementing the Page Object ...
0
votes
1answer
25 views

How to validate a particular row among many rows?

How to validate a particular row data among many rows in the table for testing in c# and once if all the data are verified than test case is passed and if not verified then fail? using System; using ...
1
vote
1answer
60 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 = ...
0
votes
1answer
35 views

Selenium OnClick identify button C#

How to identify this button in C#: <button class="reward_link_redeem_button_style" onclick="RedeemRPProduct('free_points_1')">REDEEM</button> <button class="...
0
votes
1answer
38 views

How do I pass payload to API test?

I'm creating an API testing framework, and to avoid having a test class containing 1000's of lines of code I'm looking at creating separate classes which will hold the xml data, which I'll then call ...
0
votes
1answer
46 views

Setting up an API Test Framework

I'm testing an API and I'm looking to define my payload using classes so that my program can then deserialize/serialize into any format(namely XML in my case). Below is an example of the payload <...
0
votes
1answer
28 views

XML Payload gives 'The ' ' character, hexadecimal value 0x20, cannot be included in a name.' error

I'm attempting to create a test framework in c# to automate some of our API tests. Relatively new to this area so have come across an issue I can't solve. My XML payload is as below: <Order> ...
0
votes
0answers
20 views

Creating a Request Payload in RestSharp using XML

I'm currently looking at building a test framework in c# utilising Restsharp. The payload I'm trying to create is outlined below <Order> <BillingAddress> <AddressLine1></...
0
votes
0answers
41 views

File not found exception is received when generating ExtentReport with Selenium WebDriver

When I tried to generate ExtentReport with version 3.1.3 getting below error. My code is: using AventStack.ExtentReports; using AventStack.ExtentReports.Reporter; using NUnit.Framework; using ...
3
votes
1answer
67 views

Headless browser testing

I have a question around headless browser testing which I am looking to utilise in my automation framework, which is written in c#. Headless browser testing is not an area I'm familiar with but I'm ...
0
votes
0answers
20 views

Selenium/C#/Visual Studio- Need to find a way to interact with an external app to grab data

I have a unique problem for which I can find little help. I have automated a web app but I am having a huge problem with respect to the data required for the test to run daily. The test includes a ...
2
votes
1answer
39 views

Passing parameters between tests with RestSharp

As I'm getting more familiar with the RestSharp client library for my API testing I'm confortable with using it for single API response checks e.g. checking a status code is correct, or that the ...
0
votes
2answers
43 views

Testing multiple API contracts as part of 1 test

I have a situation whereby, say, I have one API which creates an employee(POST); one which then returns the employee(GET) and one which deletes the employee(DELETE). I've been using RestSharp/C# to ...
1
vote
1answer
37 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). ...
0
votes
1answer
34 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 ...
5
votes
5answers
106 views

Useful real-world APIs to test against

In order for me to firm up my understanding of API testing I'm looking at testing against some real-world API's. For understanding, I'm going to be writing my API tests in C#, ideally utilising ...
1
vote
1answer
75 views

Configuring OAuth2 with RestSharp

I'm looking to set up a test against the Vimeo API and have been using some of the RestSharp tests to set me up. However, since these test were written Vimeo now requirs OAuth2 rather than OAuth1. I'...
1
vote
1answer
71 views

Run Selenium Automation on Microsoft Tablet chrome browser (real device)

As a part of the Automation Test, I have to set up my test framework to run tests on Microsoft Tablet(real device), I am not sure how to connect my framework with the tablet device. please suggest ...
0
votes
0answers
76 views

C# Selenium WebDriver- Conditional statement with a “Selected” method for a checkbox is clicking the checkbox at every run (ignoring the condition)

Situation: Two checkboxes on a page: CheckboxA CheckboxB Condition: if (!CheckboxA.Selected) { CheckboxA.Click(); } if (!CheckboxB.Selected) { CheckboxB.Click(); } When the test ...
1
vote
2answers
34 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 ...
2
votes
1answer
69 views

What are the pro's and con's of writing an API test automation framework at code level as opposed to using a tool

As I look into writing automation frameworks at the API layer(relatively new to this area), a question that keeps cropping up in my mind is.....why should I write an automation framework at code level ...
0
votes
2answers
158 views

Deserializing JSON response using RestSharp

I'm looking for some general advice with an API framework I am setting up using C# and RestSharp as the client library. I've successfully set up an initial test, but I'm now looking at creating a ...
0
votes
1answer
57 views

C# Selenium - How to write a conditional statement with multiple elements/xpaths

I have a problem and having trouble to finding a solution. Problem Statement: Navigate to a webpage and check if three checkboxes are selected. If not, I'd like to select them (if only one is ...
0
votes
1answer
103 views

How to use the page object model pattern in C# without deprecated libraries

What can I use as an alternative option to the soon-to-be deprecated OpenQA.Selenium.Support.PageObjects library? I still want to make sure I encapsulate the elements and be able to assemble the ...
0
votes
1answer
95 views

Clicking flipping image in selenium webdriver using C#

New to this platform I'm a beginner learning selenium webdriver with c# but I have a problem clicking on a flipping image, I identify the id but it won't click on it. I was told to use wait which ...
0
votes
1answer
33 views

Specflow tutorials which cover UI testing

When initially delving into the realm of BDD my initial foray was with Java and Cucumber. I found a wealth of knowledge online which allowed me to get to grips with this, specifically real-world ...
0
votes
1answer
30 views

How can I solve OutOfRangeException on using Selenium C#

I was faced with the below problem while trying to run a data driving testing and have tried to resolve it but nothing seem to be working for me. Please could you take a look at my code and tell me ...
0
votes
0answers
39 views

Automated tests failing with “Method not found: 'Void OpenQA.Selenium.Screenshot.SaveAsFile'” after updating .NET

I recently updated my .NET to the newest version and all of my automated tests are failing with the following error: threw an exception: System.MissingMethodException: Method not found: 'Void OpenQA....
1
vote
4answers
232 views

API Testing tools in C#

I'm looking at writing at automated tests to cover regression testing in respect of Restful API's. I have familiarity with how to do this in Java using Rest Assured, however the company I currently ...
0
votes
1answer
170 views

How to run multiple test cases sequentially in NUnit Console Runner

I'm trying to run nunit3 exe through Jenkins but after building the project, it runs all available test cases parallely. They should run sequetially. I tried where clause in nunit but how it will ...
0
votes
0answers
22 views

Cannot run dotnet Selenium app on linux

I created a service that start my dotnet Selenium application on Linux (on Windows all works well) but when I run this command: sudo systemctl start ods.service I get: PAC Support disabled ...
3
votes
2answers
58 views

Good way to update automation skills with experience in selenium+c#

I want to update my automation skills with experience in selenium+c# working as an Automation QA. I am particularly interested in courses in the London area or online courses I can take to remain up ...
0
votes
1answer
195 views

Selenium with C# “Element is no longer valid” exception being thrown when repeating steps

I am repeatedly getting a very annoying problem when automating my test cases using Selenium/C# in Visual Studio. This test is designed around validating search criteria text. In order for me to test ...
0
votes
0answers
324 views

Taking screenshot and name it like failed test using selenium WebDriver

This code takes a screenshot when test fail, but name it like my class. How to named screenshot like failed test? Example: public void ClickMyAccount() fail and screenshot must be named ClickMyAccount....
0
votes
1answer
143 views

WebDriver Exception was unhandled by user code C# NUnit Selenium

Till yeaterday i.e. 17th July 2018 I was able to successfully run my testcases. But now I'm getting below error: A exception with a null response was thrown sending an HTTP request to the remote ...
0
votes
0answers
42 views

Relative path to file in NUnit test project

This is my code which testing upload and finds a path to file, located in my project’s folder. The purpose is code to be run on any machine. Project is .NET Core: IWebDriver driver = new ChromeDriver(...
0
votes
1answer
276 views

How can i get the value from a dropdown of div class in selenium webdriver?

How can i select a value from the dropdown using selenium web driver
0
votes
1answer
557 views

Unable to click button with selenium webdriver using C#

I am having trouble with clicking a button within a modal using Selenium and C#. The button is for a photo upload, and for some reason the element that is select-able (tested with JS in the console) ...
0
votes
1answer
301 views

How to get the Indexes of all columns In a Single Row using Selenium WebDriver and C#?

For single web element in that row i got index..for multiple column in a single row how to get the index: IWebElement colelement = driver.FindElement(By.XPath("//div[@id='grdBooking']//table//tr/ th[...
2
votes
3answers
759 views

Selecting element value from drop down list with selenium using POM

I'm trying to make simple test to register in website - https://www.midomi.com/. I'm using c# and selenium but have stuck in selecting values from dropdown list using Page object model. My project ...
1
vote
1answer
51 views

Is there a C# equivalent for @FindAll in Java

Java's @FindAll allows the user to match at least one of the given criteria e.g. @FindAll({ @FindBy(className = "class1") @FindBy(className = "class2") }) private List<WebElement> ...
2
votes
3answers
631 views

How to check if the button is disabled

I have a problem how to check if the button is disabled. If button is disabled and I use Assert.IsTrue(driver.FindElement(By.XPath(OKButton)).Enabled, "OK button is disabled."); it is not finds ...