Error " Failed to enter text in the edit box, since it is read-only " when editing a WPF application
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Error " Failed to enter text in the edit box, since it is read-only " when editing a WPF application
Hello SmartBear Community
Can you Help please
I Have a test that must change the name So'phie to Sophie in this application :
The fields are fully editables and I can do it manualy like this :
But when it is testcomplete I have this error :
We tryed severals thing with delay but it not OK
Can you Help please
Thanks
Kinf Regards
Nicolas, Nikolayef
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is this a desktop or web application? Are you using script or keyword test? Have you just tried with "Sophie"?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you provide a code snippet that you use to enter data in the field?
I am just guessing that read-only control might become enabled when human user focuses it.
For example, control.Keys("Sophie") might not work, but
control.Click(); // this will, for example, replace read-only label with editable text-box
parentControl.Keys("Sophie"); // control cannot be used as it was destroyed, but its parent might exist and can be used
might appear to work.
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for reply
It is not a web app but desktop appl
here are the steps :
Aliases.JANUA_UI_WPF.HwndSource_MainWindow.ClickItem
Aliases.JANUA_UI_WPF.HwndSource_MainWindow.ClickItem.SetText"Sophie"
Aliases.JANUA_UI_WPF.HwndSource_MainWindow.ClickItem.Keys"[Enter]"
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is a keyword test
I type this
TextBox SetText "Sophie" Enters the text 'Sophie' in the 'TextBox' text editor.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I accept as a solution but it is a mistake, I don't know how to remove
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is a keyword test and I type this :
TextBox SetText "Sophie" Enters the text 'Sophie' in the 'TextBox' text editor.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use the Object Spy tool to spy on First Name edit box and create a name mapping called Firstname. Then call the following code (JavaScript) to see if it works,
Aliases.JANUA_UI_WPF.HwndSource_MainWindow.Firstname.SetText("Sophie")
If the above does not work, then try to Record Script, to see how TestComplete has identified the object and the method used to enter "Sophie"
The name mapping has to be correctly setup to identify the UI control, otherwise TestComplete will not be able to find or interact with the UI control.
To undo the accepted solution, click on the 3 dots and select un-accept solution or not the solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I would replace .SetText() with .Keys().
Does it help?
If it does not help, could you provide actual code that does not work?
P.S. I marked all replies as not solutions.
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
