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
1answer
34 views

How can i call classes under other different class?

This might be a very strange question, but I am not even sure how to title this question. I am quite new to C# and Selenium. I have done some coding on it and I'm quite comfortable creating a (very ...
1
vote
2answers
46 views

SELENIUM - How to count IWebElement in IList<IWebElement> and get the position in the list

I have a problem and I don't know how to solve that... I have 5 exactly the same elements on the page (same div, same class, no id, same inner text). So I can build the XPath - where Selenium returns ...
1
vote
1answer
28 views

How to check for a change in the Inner Text of an html

I have to check if a change was done in the inner text of an area on my website. Lets assume this to be the html of such page: <span _ngcontent-c1="" class="image"> <...
1
vote
2answers
42 views

How can I solve this Exception main” org.openqa.selenium.ElementNotInteractableException: element not interactable ?, C#

driver.FindElement(By.Id("UserName")).SendKeys("test"); driver.FindElement(By.Id("Password")).SendKeys("test123"); driver.FindElement(By.XPath("//*[@...
0
votes
0answers
19 views

Test Method does not return the value set C#

I am completely new to writing TestMethod. I am trying to write a MSTest Test Method as below to check if the Service Layer returns valid GUID [TestMethod] public async Task ...
0
votes
0answers
17 views

Specflow TestExecution.json output not including all tests run when run in parallel

Attempting to run a growing suite of Specflow tests in parallel in order to save time. However, the TestExecution.json output file only contains a random subset of tests when the run is finished, ...
1
vote
0answers
24 views

How to scan barcode using Appium?

I'm looking for approach/solution on how to scan a bar code using Appium. Is it possible through emulators? or do I need real device for this use case?
1
vote
2answers
25 views

Cannot select html td link button by XPath with Webdriver

Here is my element <td> <div class="linkButton" onclick="window.open('../../Report/Reports/ViewReport.aspx?reportName=Revenue.Report','Report1','scrollbars=1,resizable=yes,...
1
vote
1answer
44 views

XUnit test standard output gets truncated on Visual Studio

When I run Xunit tests via Visual Studio’s Test Explorer and click on the “Output” link, a new tab with the test’s log is opened in Visual Studio. The log is truncated - the following message appears: ...
0
votes
0answers
31 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 ...
0
votes
0answers
16 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
30 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 ...
2
votes
1answer
52 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
473 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
37 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
31 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 ...
1
vote
0answers
73 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?) [closed]

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
23 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. ...
0
votes
0answers
25 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....
0
votes
1answer
302 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
55 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 ...
0
votes
1answer
69 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 ...
0
votes
1answer
182 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 ...
0
votes
0answers
90 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
48 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
272 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
24 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
345 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)...
5
votes
1answer
160 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
2k 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://...
1
vote
1answer
100 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 ...
3
votes
2answers
1k 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, ...
1
vote
1answer
38 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....
0
votes
1answer
69 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
161 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
187 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 ...
3
votes
1answer
265 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
609 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
128 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
539 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
177 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
136 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
470 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
4k 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
151 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
146 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 ...

1
2 3 4 5
10