Questions tagged [selenium-webdriver-c#]
C# Flavor of the Selenium Webdriver Library
74
questions
7
votes
2
answers
34k
views
Using Python Selenium Not able to perform click operation
I am automating for the following page on CHROME Browser
https://study.yupl.us/studies/5d5a64aa8b5bb92fb776753b?auth=false
Here I'm able to identify the unique element from the console for the XPATH ...
4
votes
2
answers
5k
views
How to select the second tr of my HTML?
The code below works but it only selects the first tr:
My HTML:
<script>if(''!='') { document.Form2.endereco_ip.value='';}</script>
<div style="font-size: 10pt; font-weight: bold">...
3
votes
3
answers
359
views
Automation Testing approach for Web Based Application
I am automating a website which has multiple modules and involves users of different privileges (say Admin, User Type 1 and User Type 2). I am using Microsoft's Unit Test Tool inbuilt framework with ...
3
votes
4
answers
229
views
How many tests to include when using Page object model
I've created a basic test for checking if some article is displayed and I have a question regarding Page object model. In my solution, I've testing page, base page, map page with element id's, and ...
3
votes
1
answer
7k
views
How to Take full document screenshot including non visible parts [duplicate]
How can I take a screenshot of the full web-page (including non-visible parts) with Selenium/WebDriver using c# and the ChromeDriver?
So that is full page, including elements that are not in view, ...
3
votes
1
answer
1k
views
How to log *everything* in Selenium/WebDriver/ChromeDriver
I am struggling with this stale-element-exception. Now I had the idea that I could perhaps maximize the logging in order to get a closer look on what's actually happening. I am instantiating the ...
3
votes
2
answers
7k
views
Selenium Web Driver, ExpectedConditions [deprecated] alternative
The selenium web driver seems to be indicating that OpenQA.Selenium.Support.UI.ExpectedConditions method is now deprecated, I would humbly ask for some assistance in rewriting the below statement, ...
3
votes
0
answers
445
views
Server gets incredibly slow when running Selenium
I'm attempting to run Selenium (Chrome) test on 2 servers, each running Windows Server 2019 Standard (with GUI).
The first server (the one with the worst specs) has the following specs:
It runs ...
3
votes
1
answer
489
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 ...
2
votes
1
answer
60
views
Strange exception when executing tests
I write test automation using Selenium and C#. I use the Page Object Model consistently. And have had a random bug crop up in my code:
Type of member 'IWebDriver' is not IWebElement or IList
2
votes
3
answers
4k
views
(C#) Selenium: How to extract information from html and write to a variable
I want to know how to get the HTML tag information and write to a C# project variable. Remember that I can not change the HTML because I do not have access.
In the example below, it is necessary to ...
2
votes
2
answers
259
views
Selenium: How do I use the button of my HTML in WebElement?
How do I locate my button that has the text Pesquisar > in my Selenium WebElement?
My HTML:
<div style="font-size: 10pt; font-weight: bold">Portais
</div>
<hr>
<form name="...
2
votes
2
answers
4k
views
Selenium c# how to handle multiple "Save As" dialog?
I am testing opening multiples "Save as" dialog browser windows to make sure each dialog will download the correct file.
As a workaround I am sending user's keyboard keys to control a dialog. But it ...
2
votes
4
answers
7k
views
Encountered Error Could not load type 'OpenQA.Selenium.Internal.IWrapsElement' from assembly 'WebDriver
I'm working in multiple browser testing. It was working code with chrome browser. Recently I have installed "Install-Package Selenium.WebDriver -Version 4.0.0-alpha04".
MSedge Chromium and ...
2
votes
0
answers
3k
views
Selenium c# how to get a window title by searching by its Handle Id?
In order to get a browser window title, the web driver must switch to the window by its Handle id:
string title = driver.SwitchTo().Window("Handle ID").Title;
I am testing opening multiples windows ...
2
votes
1
answer
310
views
Selenium, updating rows, refreshing, stale items
I have a table of charges, I am creating an array of elements of the rows. I go through the line items and zero them out.
The issue is, each of these are handled by modal windows. It pops up, I ...
2
votes
1
answer
1k
views
Selenium Chrome Driver: How to Load all the Frames and get the Complete Page Source?
I'm developing an web application that monitor changes in other websites.
I came across some of the websites and that contain load of Frame set and Frames.
I'm using the below code:
var ...
1
vote
2
answers
343
views
How to select value from this dropdown list in Selenium using C# e.g. Main Feature as shown in the attached picture
Website if you want to try by your self: https://phptravels.com/ to run the script
<div class="lvl-0 dropdown">
<span>Features</span>
<div class="dropdown-...
1
vote
2
answers
1k
views
Specflow Cucumber BDD - Only log in once on test run not on every scenario
We have a Cucumber BDD test project using C# Specflow. The application is browser based tested using Selenium WebDriver automation framework.
There are a number of feature files with scenarios:
...
1
vote
1
answer
163
views
How to get Visual Studio to break on Selenium Exceptions?
Below are the categories of exceptions that I can choose to break on in Visual Studio (2019). Where should I go to find the Selenium/WebDriver Exceptions? I want to tell VS to break on all OpenQA....
1
vote
1
answer
1k
views
Teardown of Multiple Threaded Tests with Selenium
I'm trying to run multiple test cases with Nunit in C# in which every test needs its own Selenium Chrome Driver.
Before it was threaded, I handled the chrome driver with [Setup] and [Teardown] like ...
1
vote
2
answers
838
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
1
answer
2k
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
1
answer
829
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
1
answer
2k
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
1
answer
391
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
1
answer
2k
views
Not able to verify the downloaded file with Chrome WebDriver running headless
We are trying to verify the downloaded file in headless mode with C#, the file is downloading but not saving in the download path, so my test script is failing.
Any idea for this?
The code is below
...
1
vote
1
answer
66
views
Selenium to test Dygraphs
Is it possible to use selenium(C# bindings) to write automated tests for testing Dygraph charts?
If selenium does not support this? Are there any other tools which can be used?
http://dygraphs.com/
...
1
vote
1
answer
385
views
How can I keep this framework scalable?
I am developing an automated test suite for regression testing using Extent Reports, Selenium WebDriver and C#. The tests are confined to a single Visual Studio console app. What I have right now ...
1
vote
7
answers
13k
views
Get Driver Version using Selenium with C#
I am testing with C# & Selenium & Selenium.Chrome.WebDriver (Nu-GET Package, Version 2.44.0). Now I am searching for a Method which gives me the actual Version of the current runnig driver.
...
1
vote
1
answer
2k
views
Selenium Webdrive object retains page source from previous page (of CRM). But page url is current
I am writing automation scripts for Dynamics 365 using Selenium Webdriver with C#.
All is good till I login and visit first page (a list).
Test script clicks on one item in first page and page ...
1
vote
2
answers
501
views
How to get the CreatePassword verification link sent to my Email address using Selenium?
I am trying to automate a scenario wherein I am Signing Up on a WebApp which will take my email address and send a Link to my Email address using which I can create my Password.
I want to retrieve ...
1
vote
1
answer
2k
views
Unable to load MS edge chromium with Selenium
I'm trying to load the msedge chromium. encountering error.
Steps to recreate:
Installed mschromium Beta and Dev versions.
Installed the Nuget package "Install-Package Selenium.WebDriver -Version 4....
1
vote
1
answer
925
views
Keyboard ArrowDown in listbox using Selenium with C#
I'm working in selenium c# automation, I'm trying to traverse down in list box values. <ul> and <li>. I have tried many options in trial and error. The kind of code I'm trying to use is ...
1
vote
3
answers
12k
views
Access is Denied Issue thrown at ChromeDriver Initiation step
Azure DevOps is triggering and running tests on a VM.
All my tests are working fine on local machine.
On VM, While trying to launch Chrome browser using ChromeDriver and WebDriverManager, tests are ...
1
vote
1
answer
7k
views
Invalid Session id (Connect Failure) randomly when running automated tests
I've been new to automated test creation and have been dipping my hands on it recently. Every test seems to be running successfully individually except whenever I run them all together sequentially, ...
1
vote
0
answers
487
views
How can i use an existing existing chrome browser instance in selenium C#
How do I use an existing chrome browser in selenium C# ?
Currently I have the following but it always creates a new window
SessionId sessionId = new SessionId("");
var driver = new phantomJSDriver();...
1
vote
1
answer
864
views
Selenium C# Using relative XPath inside the wait.Until()
How do you use a relative xpath inside of a wait.until?
For example, the below will work:
elementA.FindElement(By.Xpath(.//div));
However, putting a 'FindElement' inside of the wait.Until() ...
1
vote
0
answers
5k
views
How to configure proxy settings for chrome in selenium c#
I want to configure the proxy settings for chrome web driver by using selenium 3.141.0 version in c#.
var co = new ChromeOptions();
Proxy proxy = new Proxy();
ProxyIPAddress proxyIP = JsonConvert....
1
vote
0
answers
70
views
Changed Selenium Framework
I am using this Selenium Set-Up in an older Project. (later called "Old-Project")
Now I want to migrate this test to a Project with this Set-Up: (later called "New-Project)
I am using a code sample ...
1
vote
2
answers
831
views
Unable to locate element (Selenium, Sharepoint2010) [closed]
I'm new in QA.
I'm using VisualStudio 2017 + Selenium WebDriver.
I'm Trying driver.FindElementById in Sharepoint 2010 web page.
It is part of the DOM:
<div id="ctl00_MSO_ContentDiv">
<a ...
0
votes
4
answers
4k
views
How to Incorporate the Defunct PageFactory in Selenium with C#?
I just discovered the page object design pattern recently and really wanted to implement it into my company's UI Test Automation suite. I started to do so and immediately ran into problems which lead ...
0
votes
3
answers
80
views
should tests be run on the same machine/server the website being tested is located on? Selenium testing
Are there any rules or articles which discuss where tests should ideally be run? Specifically smoke tests. Smoke tests should run quickly after someone checks in new code. If you are looking for fast ...
0
votes
2
answers
995
views
Unable to find Dynamic Xpath
I am unable to find dynamic xpath for below code
<input class="login_button" type="submit" tabindex="3" id="@COMMAND_EVENT@" name="@COMMAND_EVENT@" value="Submit" style="top: 20px; left: 360px; ...
0
votes
1
answer
2k
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
1
answer
2k
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
2
answers
146
views
How to Extend Automated Testing with C#/Selenium-Webdriver/NUnit Testing Past Chrome to Other Browsers?
I inherited a test automation suite that I have built a lot on top of, however I am unclear on how to migrate the current setup to use drivers past the chromedriver. I'd like to also use IE, FF, and ...
0
votes
1
answer
2k
views
C# + chrome-driver : How to fix - cannot find Chrome binary/Chrome failed to start: crashed/Failed to create a Chrome process?
I am trying to run selenium using chrome-driver in my project. While creating object of chrome-driver facing errors :
Message "unknown error: cannot find Chrome binary\n
(Driver info: ...
0
votes
2
answers
2k
views
Cant close the selenium web driver when its on a exception C#
As on my code I'm trying to find an element and click on it.
If the element is not available then there will be an exception.
So inside the exception I'm trying to close the web driver.
But as on the ...
0
votes
1
answer
430
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 ...