What is the Avalonia data binding equivalent to `UpdateSourceTrigger=PropertyChanged`? - data-binding

How do I set , UpdateSourceTrigger=PropertyChanged on a xaml {Binding} in Avalonia? When I try, compilation fails with:
System.Xaml.XamlException: 'Unable to resolve suitable regular or attached property UpdateSourceTrigger on type Avalonia.Markup.Xaml:Avalonia.Markup.Xaml.MarkupExtensions.ReflectionBindingExtension Line 91, position 100.' Line number '91' and line position '100'.

It is always PropertyChanged. I.e., other options are not supported.
See https://github.com/AvaloniaUI/Avalonia/issues/3754

Related

Cannot input text or Press Keys or Press Keycode

I am very new to robot framework, working it at pycharm.
I just want to input some text at current field. but none of these works.
I have tried
Press Keycode a
Press Keys text_field q
input text ${mylocator} ${string-abc}
If I am using the correct library?
*** Settings ***
Library AppiumLibrary run_on_failure=AppiumLibrary.CapturePageScreenshot
Library Selenium2Library run_on_failure=AppiumLibrary.CapturePageScreenshot
*** Variables ***
${MsgEditor} //*[#class='android.widget.RelativeLayout' and #resource-id='com.test.abc.work.cac:id/editor']
*** Test Cases ***
Add item
Press Keys text_field q <--error browser not open
\\or
appiumlibrary.Input Text ${MsgEditor} update <== error Message: Cannot set the element to 'update'. Did you interact with the correct element?
updated that Press Keys still failed. error:
KEYWORD Selenium2Library . Press Keys text_field, q
Documentation:
Simulates the user pressing key(s) to an element or on the active browser.
Start / End / Elapsed: 20201218 10:05:20.575 / 20201218 10:05:21.339 / 00:00:00.764
00:00:00.755KEYWORD AppiumLibrary . Capture Page Screenshot
10:05:20.575 TRACE Arguments: [ 'text_field' | 'q' ]
10:05:20.581 INFO Sending key(s) ('q',) to text_field element.
10:05:21.339 FAIL No browser is open.
10:05:21.339 DEBUG Traceback (most recent call last):
File "c:\users\tester\pycharmprojects\androidtest\venv\lib\site-packages\SeleniumLibrary\__init__.py", line 471, in run_keyword
return DynamicCore.run_keyword(self, name, args, kwargs)
File "c:\users\tester\pycharmprojects\androidtest\venv\lib\site-packages\robotlibcore.py", line 103, in run_keyword
return self.keywords[name](*args, **(kwargs or {}))
File "c:\users\tester\pycharmprojects\androidtest\venv\lib\site-packages\SeleniumLibrary\keywords\element.py", line 895, in press_keys
element = self.find_element(locator)
File "c:\users\tester\pycharmprojects\androidtest\venv\lib\site-packages\SeleniumLibrary\base\context.py", line 74, in find_element
return self.element_finder.find(locator, tag, True, required, parent)
File "c:\users\tester\pycharmprojects\androidtest\venv\lib\site-packages\SeleniumLibrary\locators\elementfinder.py", line 74, in find
parent=parent or self.driver)
File "c:\users\tester\pycharmprojects\androidtest\venv\lib\site-packages\SeleniumLibrary\base\context.py", line 32, in driver
return self.ctx.driver
File "c:\users\tester\pycharmprojects\androidtest\venv\lib\site-packages\SeleniumLibrary\__init__.py", line 547, in driver
raise NoOpenBrowser('No browser is open.')
InputText failed. I have this same InputText at other field and works. I tried tap over different field with that locator and it works.
is the app has issue on that element? but i can press on keyboard manually after tap to the field.
I recommend reading the official documentation first: http://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html and the user guide as well: https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html
Press Keys is not a keyword from AppiumLibrary. It's a keyword from SeleniumLibrary (https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Press%20Keys), but you're not importing it to your project. And even if you imported it, this keyword takes two arguments (locator and keys), so you need to use it correctly.
*** Test Cases ***
Press Keys a
In addition to what I've said, there's no test case name, this is incorrect and won't work, it will in fact give you the following error:
Test case name cannot be empty.
You have correctly used Input Test keyword from AppiumLibrary. However, you might need to validate that your locator is correct. We can't say that since you didn't include that information in your question.
I have used another method. Adb shell input text to fire the text

Xpath Error: Failed to execute 'evaluate' on 'Document':

Iam using below xpath:
//label[text()='First Name']/Parent::div/following-sibling::div/div/input[#disabled='disabled']
But showing an error as:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string
'//label[text()='First
Name']/Parent::div/following-sibling::div/div/input[#disabled='disabled']'
is not a valid XPath expression.
The error says it all - the expression is invalid. The issue is in the parent axis - it has to be in small caps, not capitalized as you've set it.
Maybe you can try to make a shorter Xpath, because seems long Xpath are hard to read, so as an example you can try with:
//button[contains(text(),'Yes')]
or
//button[contains(.,'Yes')]
Make a shorter Xpath worked for me.

Flexible unknown size in OpenMDAO

I have a Component that generates results on a 2D grid. I would like to be able to change the size of that grid as an input to the component. When I do so, I get errors such as:
ValueError: could not broadcast input array from shape (42025) into shape (40401)
I have params and unknowns like:
self.add_param('plot_res', val=201, pass_by_obj=True, description='Data output resolution')
self.add_output('out_grid', shape=201*201, description='output grid')
When I change plot_res, I get the error I pasted above.
Thanks in advance for your help.
You are not allowed to change the size of a variable after setup() has been called. Instead, I suggest that you make the desired size an argument to your __init__ method.

Page-object method to get an element location

I need to get an element coordinates(location) using cooresponding page-object method.
Now I'm using the following method to get it:
- myelementname_element.wd.location[0] --> to get X
- myelementname_element.wd.location[1] --> to get Y
But I'm constantly getting the following warning:
DEPRECATION WARNING
You are calling a method named wd at d:/JenkinsWorkspace/jenkins/...
This method does not exist in page-object so it is being passed to the driver.
This feature will be removed in the near future.
Please change your code to call the correct page-object method.
Could you please help me and provide me with corresponding page-object method?
TIA,
ANNA
To use methods supported by watir-webdriver (or selenium-webdriver) elements, but not directly supported by the page-object-gem elements, you need to first get the native element. This is done by calling the element method for the page-object-gem element:
myelementname_element.element
As you can see, you can get the three different gem element classes by doing:
puts page.myelementname_element.class
#=> PageObject::Elements::TextField
puts page.myelementname_element.element.class
#=> Watir::TextField
puts page.myelementname_element.element.wd.class
#=> Selenium::WebDriver::Element
For your specific example, you want to do:
myelementname_element.element.wd.location[0]
myelementname_element.element.wd.location[1]

Programmatically adding new line in mx:TextArea

I have a flex 4.5 application. I want to add new line in an mx:TextArea when certain event occurs. I have been searching for the proper way to add a OS independent line ending. I found out that the File class has lineEnding property. However the documentation states that this class is not exposed when running inside a browser (which is my case).
I have searched, but I couldn't find any other class, which can provide this information. Actually I am not sure if the TextArea line ending is OS dependent or not.
So actually I have two questions: Are TextArea line endings OS dependent or not? And if so, how can I get the proper line ending in flex?
You can use String.fromCharCode(13). This will return a line ending.
This is the equivalent of PHP's chr() method.
Example:
var address_str:String = "dog" + String.fromCharCode(64) + "house.net";
trace(address_str); // output: dog#house.net
From my experience, "\r" works in both Windows and Mac.
Quite simply, you just need to add the newline character to the text of the textArea.
myTextArea.text+="\n"; //This should work, if not try the other two
myTextArea.text+="\r";
myTextArea.text+="\r\n";

Resources