Code coverage in Visual Studio works by instrumenting the application under test so it should work well with any type of test (Even Manual tests done under MTM). To get coverage based on test type simply tag your tests with what type they are then run the test filtered by each type. Previous Post, I have shown you how to run selenium WebDriver code in Visual Studio with NUnit Framework. Now I will show you how Selenium WebDriver code generated from selenium IDE can be run at Visual studio Test Framework. Running C# NUnit based Selenium WebDriver tests in Visual Studio Code in Mac OS (OSX) C# + NUnit + Selenium WebDriver + Visual Studio Code + OSX.
- Today we are announcing the release of Visual Studio for Mac version 7.6.Our focus with this release has been to improve product reliability in various areas, with a special focus on the code editing experience.
- Visual studio for mac free download - Mac Screen Recorder Studio, 4Media iPod to Mac Transfer, 4Media Download YouTube Video for Mac, and many more programs.
- The use of Selenium Webdriver is to basically test any web application. C# is a programming language of Microsoft that enables developers to build a variety of secure and robust application that run on the.NET Framework.
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upHave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
commented Jun 16, 2017 • edited
edited
Environment: Browser: Safari 10.1.1 Mac os: macOS Sierra 10.12.5 WebDriver: Selenium 3.4.0 Script: C# Platform: Visual studio Safari extension i added in safari browser version is: 2.48.0 Expected Behavior: Safari Browser windows should maximized. Actual Behavior: No action performed when run this code: webDriver.Manage().Window.Maximize(); I have tried with below codes but no actions performed :( ((IJavaScriptExecutor)webDriver).ExecuteScript('document.body.style.zoom = '100%';'); webDriver.Manage().Window.Maximize(); ((IJavaScriptExecutor)webDriver).ExecuteScript('window.resizeTo(100,110);'); Thanks! Elango |
commented Jun 18, 2017
I am facing the same issue on Mac Sierra and Chrome Version 61.0.3128.0 (Official Build) dev (64-bit) . Should I need to file another issue or should I add my comments here? |
commented Jun 18, 2017 • edited
edited
Have you tried with lower version of selenium web driver?? @zac11 |
commented Jun 19, 2017
@Elangopalakrishnan Well no, I haven't tried this with any other version of Selenium. My project requires me to use latest version of Chrome with latest version of Selenium. |
commented Jun 19, 2017
Hi, Initially i thought, It is because of selenium 3.4.0 version, But i tried now with selenium 2.53.1 version, But still i face same issue, Is there any changes in Safari Extension 2.48 ? I can see it is latest is Safari Extension 2.48 (DEPRECATED use Apple's Extension). [http://www.seleniumhq.org/download/] So i installed Browserling Extension (It supports Safari, Chrome and Firefox) and added into extension. But still webDriver.Manage().Window.Maximize(); Not working. @zac11 Please try this Apple's own extension and let me know it is working or not in chrome plz.. For me not working :( Thanks! Elango |
commented Jun 19, 2017
The same issue on Mac (El Capitan) and Safari 9.1 org.openqa.selenium.ScriptTimeoutException: Timed out awaiting response to command 'maximizeWindow' after 30003 ms after driver.manage().window().maximize() |
commented Jun 19, 2017
For Safari 10.1.1: #3796 (and a couple others) would suggest that this is a Safari bug (and will hopefully be corrected with the next release per this comment). |
commented Jun 20, 2017 • edited
edited
@FA-tvonmoll , As per your previous comment, I have installed safari technology preview in my mac book, but how can i set the capabilities to launch that safari technology preview browser in my machine by using selenium webdriver ? I tried below code in c# script- DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.SetCapability('browserName', 'safari technology preview'); It doesn't work, it shows exception- 'The best matching driver provider org.openqa.selenium.safari.SafariDriver can't create a new driver instance for Capabilities [{browserName=safari technology preview}] Build info: version: '3.4.0', revision: 'unknown', time: 'unknown' System info: host: 'mkusers-iMac.local', ip: '10.18.15.42', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.4', java.version: '1.8.0_131' Driver info: driver.version: unknown' am i missing any capabilities here?? Thanks! Elango |
commented Jun 20, 2017
I also have problems in setting UseTechnologyPreview to true in c# - tried SafariOptions o = new SafariOptions(); o.AddAdditionalCapability('technologyPreview', 'true'); and o.AddAdditionalCapability('useTechnologyPreview', 'true'); both not working |
![Studio Studio](https://developercommunity.visualstudio.com/storage/attachments/4838-report-fig002.png)
commented Jun 20, 2017
@svetikshark please refer #3796, here is the solution in java code :) |
commented Jun 20, 2017 • edited
edited
In c# there is no setUseTechnologyPreview function for Safaridriver for selenium 3.0.1 that's why I'm trying to add them with available AddAdditionalCapability function. Correct me please if I'm doing smth wrong |
commented Jun 20, 2017 • edited
edited
@svetikshark Can you post full launch code? I tied this, but not working:(capabilities.SetCapability('UseCleanSession', 'true'); capabilities.SetCapability('UseTechnologyPreview', 'true'); |
commented Jun 20, 2017
using OpenQA.Selenium.Safari; private static DesiredCapabilities ForSafari() { SafariOptions o = new SafariOptions(); o.AddAdditionalCapability('technologyPreview','true'); DesiredCapabilities capabilities = (DesiredCapabilities)o.ToCapabilities(); capabilities.SetCapability('browserName', 'safari'); capabilities.SetCapability('applicationName', 'desktop'); capabilities.SetCapability('javascriptEnable', 'true'); capabilities.SetCapability('cssSelectorsEnable', 'true'); capabilities.SetCapability('platform', 'MAC'); capabilities.SetCapability('secureSsl', 'true'); capabilities.SetCapability('takeScreenshot', 'true'); return capabilities; } and I'm using it for remoteWebDriver wd = new RemoteWebDriver(hubUri, capabilities, _commandTimeout) |
commented Jun 20, 2017 • edited
edited
@svetikshark you are correct, options.AddAdditionalCapability('technologyPreview','true'); is not working in c#, It is launching Normal safari browser. I tried below code: SafariOptions options = new SafariOptions(); options.AddAdditionalCapability('UseCleanSession', true); options.AddAdditionalCapability('UseTechnologyPreview', true); options.AddAdditionalCapability(CapabilityType.AcceptSslCertificates, true); options.AddAdditionalCapability(CapabilityType.AcceptInsecureCertificates, true); DesiredCapabilities capabilities = (DesiredCapabilities)options.ToCapabilities(); RemoteWebDriver rwd = new RemoteWebDriver(new Uri('URL:5555/wd/hub'), capabilities, TimeSpan.FromSeconds(180)); Don't know what to do :( |
commented Jun 21, 2017
commented Jun 21, 2017 • edited
edited
SafariDriverService serv = SafariDriverService.CreateDefaultService('/Applications/Safari Technology Preview.app/Contents/MacOS/', 'safaridriver'); SafariOptions opts = new SafariOptions(); opts.AddAdditionalCapability(CapabilityType.AcceptSslCertificates, true); opts.AddAdditionalCapability(CapabilityType.AcceptInsecureCertificates, true); opts.AddAdditionalCapability('cleanSession', true); DesiredCapabilities capabilities = new DesiredCapabilities(); webDriver = new SafariDriver(serv, opts); RemoteWebDriver rwd = new RemoteWebDriver(new Uri('http://URL:5555/wd/hub'), capabilities, TimeSpan.FromSeconds(180)); This code throws exception , At first line 'SafariDriverService serv = SafariDriverService.CreateDefaultService('/Applications/Safari Technology Preview.app/Contents/MacOS/', 'safaridriver'); ' safaridriver can be downloaded from apple.com Is i need to do anything on mac machine? |
commented Jun 21, 2017
In my understanding this service should be started on machine which is going to execute the driver.Are you running it from mac machine? cause in my case node and hub are different machines so I don't see the way to start service on mac and send this info to hub on linux |
commented Jun 21, 2017
I have safari technology preview - /Applications/Safari Technology Preview.app safaridriver - /usr/bin/safaridriver in my mac seirra, But still Normal safari browser only launching when i run below code in c# SafariOptions options = new SafariOptions(); options.AddAdditionalCapability('UseCleanSession', true); options.AddAdditionalCapability('UseTechnologyPreview', true); options.AddAdditionalCapability(CapabilityType.AcceptSslCertificates, true); options.AddAdditionalCapability(CapabilityType.AcceptInsecureCertificates, true); DesiredCapabilities capabilities = (DesiredCapabilities)options.ToCapabilities(); RemoteWebDriver rwd = new RemoteWebDriver(new Uri('URL:5555/wd/hub'), capabilities, TimeSpan.FromSeconds(180)); It should launch safari technology preview (violate color) safari logo browser right??? |
commented Jun 22, 2017
@chandrasekharmelam thanks for code, It is working fine in local machine, but i need to launch safari browser in my remote mac machine. webDriver = new SafariDriver(); webDriver.Navigate().GoToUrl('www.google.com'); webDriver.Manage().Window.Maximize(); How we will write for remote webdriver, RemoteWebDriver rwd = new RemoteWebDriver(new Uri('URL:5555/wd/hub'), capabilities, TimeSpan.FromSeconds(180)); If i write , webDriver = new safariDriver(); Where i can specify the remote machine ipaddress and port ? |
![Selenium visual studio 2017 Selenium visual studio 2017](https://www.ecanarys.com/sites/default/files/chandani.sannakki-439/2017-02-07 12_28_11-SeleniumForBeginners - Microsoft Visual Studio.png)
Selenium Visual Studio Code
commented Jul 17, 2017
It's a safari driver issue, we hardly can do anything on the client side. As for technologyPreview switch, please watch #4209 |
bot locked and limited conversation to collaborators Aug 18, 2019
Visual Studio Selenium Setup
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.