New issue
Have 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
Find control's properties #236
Comments
You can try exporting the PageSource to an XML file and then
You will get clue for your Intended property or attribute values to pass as an argument in GetAttribute function from this exported XML file. I'm not sure if we can set value of the control by setting the value of attribute, even if we can it would not be a good idea because the background events are not triggered for some controls. You will have to utilize the exposed methods like Click(), SendKeys() etc. to set the values. Regards |
@dhapolapankaj Thanks. |
:) I would still insist you to export the PageSource try below code
See if you have got the "App_To_XML.xml" file generated Let us know if you are enlightened. |
Hi @CheNMorD, Typically, I would use var originalState = checkBoxElement1.Selected;
checkBoxElement1.Click();
Assert.AreNotEqual(originalState, checkBoxElement1.Selected);
checkBoxElement1.Click();
Assert.AreEqual(originalState, checkBoxElement1.Selected); For any other element properties shown on inspect.exe, you can use the Note that element properties that are not exposed to the accessibility layer such as background color and font, cannot be retrieved by Windows Application Driver nor |
As described by @bharathp666 in #590 we can check the whole xml document through driver.PageSource. |
Hi,
I'm using appium in visual studio for testing a simple WPF application,
I'm using WindowsDriver
WindowsDriver<WindowsElement> driver = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), desiredCapabilities);
I know how to enter text and how to get text from TextBox:
driver.FindElementByAccessibilityId("MyTextBox").SendKeys("123");
I wanted to know if there any way to get and set control's properties, For example: get IsChecked from CheckBox, get Background from TextBlock etc.
Thanks.
The text was updated successfully, but these errors were encountered: