Comments (6)
This is something we don't have a specific API for currently but can access the enabled attribute on the element. You can use the xrmBrowser.Document.getElementById("firstname").GetAttribute("disabled"); try get the details.
from easyrepro.
Sorry but could you provide some more help with this. When I tried grabbing a field with
var FName = xrmBrowser.Document.getElementById("firstname")
I can see the full element in the watcher. However if I try
var FNameDisplay = xrmBrowser.Document.getElementById("firstname").GetAttribute("disabled");
or
var FNameDisplay = xrmBrowser.Document.getElementById("firstname").GetAttribute("Displayed");
it comes up as null in the watcher. What am I doing wrong?
from easyrepro.
Ok, it looks like there will be a span that has a lock image. The disabled setting is never set. Try something like this.
if (xrmBrowser.Document.getElementById("firstname_lock").GetAttribute("style") == "display: block;")
{
//do something
}
from easyrepro.
You can also execute client script that will get the control disabled status.
xrmBrowser.Driver.ExecuteScript("Xrm.Page.ui.controls.get('firstname').getDisabled();").ToString();
That should return True or False.
from easyrepro.
So I was still getting an error with
xrmBrowser.Driver.ExecuteScript("Xrm.Page.ui.controls.get('firstname').getDisabled();").ToString();
I was getting a NullReferenceException
We ended up realising it was already present in the IWebElement properties.....
var FNameDisplay = xrmBrowser.Document.getElementById("firstname").Displayed
from easyrepro.
this actually works
xrmBrowser.Driver.ExecuteScript($"return Xrm.Page.getControl('firstname').getDisabled();");
so the previous
xrmBrowser.Driver.ExecuteScript("Xrm.Page.ui.controls.get('firstname').getDisabled();").ToString();
was missing the "return
"
from easyrepro.
Related Issues (20)
- [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
- Url is not working even after adding & in the url in app.config file HOT 1
- How can I effectively load and execute the EasyRepro framework within Visual Studio Code? HOT 1
- Not able to find xpath from inspect element for any change area options.
- [HOW-TO] Using .NET Core HOT 2
- [BUG] Sample Project won't build - missing NuGet package: Selenium.WebDriver.ChromeDriver - Visual Studio 2022 HOT 1
- Not able to receive sms OTP on Twilio number. HOT 1
- how to set screen resolution in azure pipeline HOT 1
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.