Comments (15)
chandramohand This option is not supported now by Framework, but you can try extend with the custom solution https://stackoverflow.com/questions/48007699/how-to-allow-or-deny-notification-geo-location-microphone-camera-pop-up
One more option implement custom login and use WinAppDriver to handle dialog
from easyrepro.
Thanks @Shakevg, let me try and update you if any issues.
from easyrepro.
Hi @Shakevg, I am unable to pass this extra option to the same browser, where I am using the following browser options.
If i declare [ ChromeOptions opt;
opt.AddArgument("--disable-geolocation"); ] I need to pass this new webdriver, where its going to apply for new broswer.
How can I pass this location disable option, to the existing client only?
public static BrowserOptions Options = new BrowserOptions
{
BrowserType = (BrowserType)Enum.Parse(typeof(BrowserType), Type),
PrivateMode = true,
FireEvents = false,
Headless = false,
UserAgent = false,
DefaultThinkTime = 2000,
UCITestMode = true,
CookieСontrolsMode = 0,
};
from easyrepro.
chandramohand 2 options:
- Include library source code to your project and modify the source with a new option
- Implement new option in Framework and commit to GitHub
from easyrepro.
@chandramohand
I didn't test it for this argument, but, if you use Chrome, you can use the ExtraChromeArguments Option as follows.
//1. Global in [ClassInitialize] or [AssemblyInitialize] methods
TestSettings.SharedOptions.ExtraChromeArguments = new[] { "--disable-geolocation" };
// 2. just for one test
var options = TestSettings.Options;
options.ExtraChromeArguments = new[] { "--disable-geolocation" };
var client = new WebClient(options);
using (var xrmApp = new XrmApp(client))
{
...
from easyrepro.
Thanks @AngelRodriguez8008, @sharkdevs I am trying to use the second options in my settings where not allowing the ExtraChromeArguments options. Running thise in incognito mode.
protected XrmApp XrmApp
{
get
{
if (_xrmApp == null)
{
var options = TestSettings.Options;
options.ExtraChromeArguments = new[] { "--disable-geolocation" };
var client = new WebClient(options);
_xrmApp = new XrmApp(Client);
}
return _xrmApp;
}
}
I am getting the following error.
Severity Code Description Project File Line Suppression State
Error CS1061 'BrowserOptions' does not contain a definition for 'ExtraChromeArguments' and no accessible extension method 'ExtraChromeArguments' accepting a first argument of type 'BrowserOptions' could be found (are you missing a using directive or an assembly reference?) Ntdt.Tests C:\Users\dast0002\source\repos\test\Ntdt.Tests\Ntdt.Tests.Tests\XrmBinding.cs 41 Active
Option 2: Tried as the following by adding the argument, but still the dialog opens.
Trying to assigning the folloiwng options to client.
var options = TestSettings.Options;
options.ToChrome().AddArgument("--disable-geolocation");
Could you please help me.
Thanks,
Chandra.
from easyrepro.
@chandramohand
Sorry, this logic was implemented just in my fork. I add a Pull Request that support my sample code.
You can download & compile it or wait until the PR get approved.
I also added this particular configuration to a Sample Test Case
options.ExtraChromeArguments = new[] { "--disable-geolocation" };
With the new code, you can also change the SharedOptions initialization in your project in order to enable this configuration for all your tests. Just add this line:
ExtraChromeArguments = new[] { "--disable-geolocation" };
at the end of the follow BrowserOptions constructor call.
TestSettings.SharedOptions, after line 51
The Option 2 as you implemented it will not work. You are getting your own copy of the Options, but this will not be used for the driver later on.
from easyrepro.
Hi @AngelRodriguez8008, Thanks for quick response.
Few things just want to check, whether this supports the old chrome browser 101 version? when I ran the lab test its expecting 113 version. Please confirm.
2nd hope this will work fine in private mode.
Thanks and Regards,
Chandra.
from easyrepro.
@chandramohand
you should up- or downgrade the Selenium.WebDriver.ChromeDriver to the desired version.
private mode should not be a problem
from easyrepro.
Hi @AngelRodriguez8008,
Applied the changes to my portal but its not working, where the location dialogue opens after login which is required to load the map. I tried both enable and disable, but didnt work.
Thanks,
Chandra.
from easyrepro.
Hi @AngelRodriguez8008,
Hope you are doing good. Any update regarding this?
Thanks,
Chandra
from easyrepro.
The Pull Request is waiting to be reviewed. How I said, you can try to get the new code/branch & compile it for yourself.
In other case, you should wait for some of the repository owners.
from easyrepro.
The Pull Request is waiting to be reviewed. How I said, you can try to get the new code/branch & compile it for yourself. In other case, you should wait for some of the repository owners.
Thanks @AngelRodriguez8008, I got the code for Browseroptions and TestSetting and tried on my CRM app, please refer to the following code. Still after login the dialogue still remains. Here in the CRM app I need to allow the location, where it pulls only those location points. I want to check initally whethere the dialog get closes, later I will try making enable location.
[TestCategory("Labs - TestsBase")]
[TestMethod]
public void NotUsing_TheBaseClass()
{
var options = TestSettings.Options;
options.PrivateMode = true;
options.TimeFactor = 1.5f;
options.ExtraChromeArguments = new[] { "--disable-geolocation" };
options.UCIPerformanceMode = false; // <= you can also change other settings here, for this tests only
var client = new WebClient(options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password, _mfaSecretKey); // Here I am passing my app details
Assert.IsNotNull("Replace this line with your test code");
} // Note: that here get the Browser closed, xrmApp get disposed
}
Thanks and Regards,
Chandra.
from easyrepro.
Hi @chandramohand
The Pull Request is waiting to be reviewed. How I said, you can try to get the new code/branch & compile it for yourself. In other case, you should wait for some of the repository owners.Thanks @AngelRodriguez8008, I got the code for Browseroptions and TestSetting and tried on my CRM app, please refer to the following code. Still after login the dialogue still remains. Here in the CRM app I need to allow the location, where it pulls only those location points. I want to check initally whethere the dialog get closes, later I will try making enable location. [TestCategory("Labs - TestsBase")] [TestMethod] public void NotUsing_TheBaseClass() { var options = TestSettings.Options; options.PrivateMode = true; options.TimeFactor = 1.5f; options.ExtraChromeArguments = new[] { "--disable-geolocation" };
options.UCIPerformanceMode = false; // <= you can also change other settings here, for this tests only var client = new WebClient(options); using (var xrmApp = new XrmApp(client)) { xrmApp.OnlineLogin.Login(_xrmUri, _username, _password, _mfaSecretKey); // Here I am passing my app details Assert.IsNotNull("Replace this line with your test code"); } // Note: that here get the Browser closed, xrmApp get disposed }
Thanks and Regards, Chandra.
Hi @AngelRodriguez8008, I tried with the sample but didnt work, just want to follow up, as I see the pull request is in still Review state, Any update regarding this. Thanks, Chandra.
from easyrepro.
Hi @AngelRodriguez8008, any update of this PR?
Thanks,
Chandra.
from easyrepro.
Related Issues (20)
- Why in my CRM app doesnt work this? xrmApp.Grid.OpenRecord(0); HOT 1
- Release Wave 2 - 2023 - SelectForm() is broken when the script runs with New look
- Unable to Login thru automation in Power App HOT 2
- Compatibility with selenium 4.11 version and CFT
- [BUG] Command Bar not found when header is expanded
- [FEATURE] Get/Retrieve/Search records from timeline
- [BUG] Setting value on Subject field on Case entity (tree-view type)
- [FEATURE] Read the Values from the SLA Timer Section
- [HOW-TO] Run tests on Jenkins
- [HOW-TO] Use with Customer Service Workspace app
- [HOW-TO] <implement read data from excel in easyrepro> HOT 2
- Command xrmApp.Navigation.OpenSubArea("Area", "Sub-Area"); running in Local but failing in pipeline
- How to Close Alert dialogue box of Dynamics crm Opened via Xrm.Navigation.openAlertDialog.
- .NET 6 not .NET Core 6
- Timeout Issue with System.Net.HttpWebRequest.GetResponse()
- [BUG] <Getting webdriver exception "unknown error: unable to discover open pages" when running the test on server through ADO test plan. Code works locally>
- [BUG]GetFormNotifications() does not get notifications text. Get error
- Moving to .NET Core HOT 1
- MFA secret key issue HOT 8
- How to click on the phone (subgrid record header) phone number HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easyrepro.