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.

Filter by
Sorted by
Tagged with
1
vote
0answers
21 views

How to run appium tests parallel in c# specflow?

I am new to C# and Specflow. I am using appium, c# and specflow for automating my tests. I have a app.config file where i am mentioning the environment to be run into. A driver class DeviceDriver.cs ...
1
vote
0answers
14 views

vsdiagnostics profiling missing expected information

I'm trying to profile a command line C# application (VS 2019) on a remote server with no VS installed. I'm following the procedure here. The application depends upon a couple internal libraries that ...
0
votes
1answer
24 views

Appium How to iterate over a listview of unknown length?

IList<AppiumWebElement> els = AppiumDriver.FindElementsByClassName("android.widget.LinearLayout"); var loc1 = els[12].Location; var target = els[1]; var loc2 = target.Location; var ...
1
vote
1answer
47 views

Browser is closed only if test passed on VM

I use driver.Dispose(); and using ChromeDriver. But the browser is closed only if the test passed. On the VM if a test failed, the browser is still open. If I run tests from Visual Studio on local ...
0
votes
2answers
239 views

What is the optimal solution when there is incompatibility between Chromedriver & Google Chrome?

Error: System.InvalidOperationException : session not created: This version of ChromeDriver only supports Chrome version 85 (SessionNotCreated) I am using Google Chrome Version 87.0.4280.66 (Official ...
1
vote
0answers
35 views

Two way authentication okta testing?

I am not sure if this is possible. I was task of getting an access token from okta. The problem is okta is using a two way authentication system where it will send a push notification on your phone ...
0
votes
0answers
27 views

Are there any open source c# based fuzzy input generators?

I'm looking to do fuzz testing with my inputs. The entire stack I'm testing is impliment in c# so I'm really not worried about memory management type errors, I just want to find scenarios where we ...
0
votes
0answers
45 views

Azure:build pipeline:Error The type or namespace name 'XXXX' could not be found (are you missing a using directive or an assembly reference?)

I am trying to build task in Azure pipeline. Observed error : The type or namespace name 'XXXX' could not be found (are you missing a using directive or an assembly reference?) Please let me know if ...
0
votes
0answers
22 views

Azure + Appium + C# : While creating azure pipeline I am getting error “You are not authorized to access https://dss-hps.visualstudio.com.”

I am trying to create Azure pipeline to integrate automation. Observed error : You are not authorized to access https://dss-hps.visualstudio.com. Please let me know if anyone face/fix this issue. ...
1
vote
0answers
24 views

Is there a way to automatically create Azure Dev Ops test cases from a test assembly or from a solution with test scripts?

Is there a way to automatically create Azure Dev Ops test cases from a test assembly or from a solution with test scripts? With TFS 2015, I know that you can automatically create cases using the tcm....
1
vote
1answer
165 views

Need to remove some items from a IList Selenium C#

When I execute below command I'm getting more than 3000 items to my elm variable. Then I have to pass them in to a string array. The below list contain so many blank data and there are some items ...
0
votes
1answer
45 views

Run series of tests using one browser instance - Selenium web-driver c# i

I developed a series of unit tests in Visual Studio 2019, C# Selenium. How can run back to back with one browser instance? For example, the first test is going through a series of steps and creates a ...
1
vote
1answer
47 views

Not able to select option from div type listbox in selenium C#

Here the id=popupY8cuUiMiDU is dynamic.I need to get the Y value from span but there are multiple listbox with the same span attribute taking Y option. How can I select from listbox as there is no ...
1
vote
1answer
131 views

Selenium C# Locate Both Data QA Attribute And CSS Class

How do we locate both Data QA Id and CSS Class using Selenium C# ? We're trying to locate both a DataQAid attribute and also see if its class ng-invalid, (Angular Material Textbox Error) This is what ...
1
vote
0answers
63 views

Sikuli4Net is giving me an error on C# selenium

I was trying to implement image based verification on my selenium project with the help on Sikuli4Net. After following some tutorials I'm getting an error as below. The request was aborted: Could not ...
-2
votes
1answer
46 views

Performance Testing: Flag when a UI/API test's runtime increases by x% (Selenium C# Azure)

Our team currently use Selenium and C# (and NUnit) to run UI Automated tests. All tests have been manually programmed, meaning no recorders have been used. Issue: We now have a request that these ...
0
votes
1answer
197 views

Fixing an asynchronous JavaScript timeout out issue with Selenium in C#

Background I am running the following JavaScript code using the C# bindings for Selenium: async function addTableCellClassInjector(row, tableIndex, rowIndex) { for (let columnIndex = 0; column = ...
0
votes
0answers
21 views

How to handle excel - multiple sheet integration with ODBC driver in C#

I am having one issue in fetching data from excel sheet where I have 4 sheets in one excel file and all sheets have one same unique Key value Issue I am facing is that - I want to fetch data from all ...
0
votes
0answers
22 views

“NoSuchElementException” is thrown even if the element is present and loaded properly

I have a code that checks for an element first before proceeding with taking a screenshot of the page, it won't stop the run but it will throw a runtime exception if the element is not found. At first ...
3
votes
1answer
268 views

Selenium Click not working on IE11 using c#

Local Machine: Dell Latitude (i7-8650U CPU @ 1.90GHz 2.11 GHz) with 16.0 GB RAM Operating System: Windows 10 Pro (64-bit) v1909 Display Scale and Layout: 100% Running on Visual Studio 2017 (v 15.9.21)...
0
votes
0answers
75 views

Get the locator from IWebElement

I'm doing the following: var locators = new ByChained(By.XPath("//div[@id='historyModal']//div[@class='modal-body']", By.ClassName("historyItem")); var historyValues = WebDriver.FindElements(locators)...
5
votes
1answer
128 views

Appium : Best way to automate e-Signature scenario using Appium?

How to Automate e-Signature? I am trying to automate e-Signature scenario for iOS and android application. Anyone implemented same using Appium? Workaround : I tried to automate e-Signature using ...
1
vote
1answer
1k views

How to open new tab using selenium C#?

Here is the code I have written But it is not working Any suggestion will be helpful IWebDriver driver = new ChromeDriver(@"C:\Selenium Automation\"); driver.Navigate().GoToUrl("https://...
0
votes
0answers
68 views

NUnit - Get name of test fixture in OneTimeSetUp?

Is it possible to get the name of the test fixture in the OneTimeSetUp method? I can see how to get the currently executing test easily enough (TestContext.CurrentContext.Test.Name) but is there an ...
1
vote
1answer
69 views

NUnit Assert.This(obj, method) for C# - where to find list of evaluation methods?

I'm an old embedded coder, new to NUnit and VS C#. I'm trying to get used to the Assert.That(obj,[EvaluationMethod]) methodology that NUnit 3.x is promoting. I'm slowly getting up to speed, but was ...
4
votes
2answers
754 views

Test Automation for different user roles within an application - Selenium and C#

I was a developer a long time ago and have been tasked with our teams automated testing with Selenium and C# for our web application; Our application has many roles a user can be; such as an admin, ...
2
votes
1answer
37 views

Appium - get all elements

I have this code that works where driver is of type IOSDriver<IOSElement> string selector = "type == 'XCUIElementTypeButton'"; foreach (var elt in driver.FindElements(MobileBy....
1
vote
1answer
60 views

Selenium Is Unable To Locate A Web Element – C#

I get an error message on trying to run this code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TechTalk.SpecFlow; using ...
1
vote
0answers
122 views

How do I make a custom logger for Fluent Assertions?

I'm using NUnit and Fluent Assertions for testing. I'd like to write a custom logger for my test steps which shows which steps have passed and the step (if any) that failed. It looks like someone has ...
2
votes
2answers
99 views

Specflow step is not bound even though the underlying step definitions have been implemented

Hello, the step has not been bound (hence, colour purple), even though the underlying step defintions have been implemented. In the screen shot, I clicked on "Ok". V/Studio takes me to the screen in ...
0
votes
0answers
24 views

Interacting with OAuth 2.0 elements using Appium in C#

I'm trying to write tests that interact with an Android application. We recently moved to OAuth 2.0, in which the application moves to a separate custom tab with a web view. I tried to use Appium ...
0
votes
0answers
98 views

Problem with C# project analysis with sonarcloud at azure build pipeline

I add a SonarCloud Azure DevOps extension Then I run the pipeline and I got the below output.(It actualy identify my c# code as valid cs files ,47 files indexed). But at the SonarCloud dashboard ...
3
votes
1answer
199 views

Running Selenium not under a Testing Framework

I've been using Selenium for a while but with a slightly different scope (actually constraints). Instead of running a test for a particular site, I'm interested for instance in filling in a web form ...
0
votes
3answers
483 views

Selenium WebDriver - handling authentication popups in Chrome and Edge

We have an internal web application that I am trying to automate using Selenium and BrowserStack, in C#. I have managed to use BrowserStack's 'local' functionality to get at the application but I'm ...
1
vote
1answer
44 views

Writing to notepad based on environment

Does anyone know of a way that I can write to my notepad file, but depending on the environment it is running on, what notepad file to write to? So for example, I've automated an account setup, as it ...
0
votes
1answer
85 views

Selenium C# - verifying the drop down was selected item

I have selected the drop-down now i want to verify the selected drop down is correct using Assert I have noticed that the selected item has attribute "selected" var ftpTransDropdown = Driver....
0
votes
2answers
432 views

I absolutely cannot get this xpath to work… selecting a radio button

I have been trying for days to select this button... I've tried xpaths by ID type, input type, child of, etc. What am I missing here, why is VS unable to locate the "element" ? I can use the same ...
0
votes
2answers
143 views

Testing multiple browser configurations via Selenium WebDriver

When covering cross-browser testing using Selenium WebDriver, how do you provide the browser and version information to the tool (e.g. BrowserStack, Sauce Labs)? For example, you're wanting to execute ...
3
votes
2answers
114 views

Selenium WebDriver - should explicit waits be held in the test method or within the page object?

As the question title says: If you're putting a test together and you need to wait for an item to be displayed (as an example), is it best to put the explicit wait within the test or against the page? ...
0
votes
1answer
369 views

How to assert web element is non editable selenium c#

Depending on a condition a input or a div gets render on browser. In my UI automation test I need to assert the div is a non-editable element. I achieved this as- var readOnlyLocation = Driver....
2
votes
3answers
3k views

How to automate Microsoft two-way authentication based login page in Selenium using C#?

In an application user needs to enter email id and password on a Microsoft login page. After clicking on the Log in button, it sends a sms to a mobile number. Now User has to enter the OTP to login in ...
0
votes
1answer
35 views

Testing my own stack class

Im creating a very simple stack class to implement my learnings on TDD. I have created a test that will create a stack and check the length of it. This is my test class: using NUnit.Framework; ...
1
vote
2answers
115 views

Can some one help me to find the CSS selector for highlighted item

Could someone help me to identify the correct csslocator for the second span element in the below image: I tried the below locators but was not able to succeed, is there anything wrong with the ...
16
votes
6answers
5k views

Writing test automation in Java, while the company domain uses C#/.NET

I´ve recently got a job as a automation tester in a company, that basically only have manual testers (except me). The short term plan is to come up with a good test strategy for identifying which of ...
0
votes
2answers
113 views

Waiting for spinner to disappear does not work

I'm using the code below, waiting for "Loading" spinner to disappear. But I noticed that next test step does not wait until the spinner to disappear. Example: click on button_1 (after click, spinner ...
-2
votes
1answer
21 views

How to provide File and some para. to POST API using Python/ C#?

Team, I am trying to provide File and some para. as a input for API. Expecting output based on validation. Even after providing both inputs correctly, I am getting File as null with length 0. Below ...
0
votes
2answers
114 views

How to validate a successful file download test senario from selenium [duplicate]

I need to automate the following test senario where when I click on a button, a file will be downloaded There will be no message box and no text message. How should I implement this scenario ...
0
votes
3answers
60 views

Can some one please suggest a proper CSS name to find this element

I need to click on the above button just using CSSSelector . I have tried with ; > IWebElement el4m = > Driver.FindElement(By.CssSelector("input[type='button'][contain='Search']")); > ...
1
vote
1answer
460 views

How to generate report using extent reports in Page Object Model in C#

I have created a POM framework using NUnit in C#. I have created Reporting.cs file which creates reports for the test in that class. How I can generate reports for all tests in different classes ...
0
votes
1answer
33 views

How to find path to filtervalue

Can you help me how to find a path to desired "filtervalue", such as value "Search in active documents"? As you can see in the picture, the class filtervalue is there multiple times. Thank you in ...

1
2 3 4 5
10