Ask a Question

Error " Failed to enter text in the edit box, since it is read-only " when editing a WPF application

Nikolayev
Contributor

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 :

Nikolayev_2-1683209103332.png

 

The fields are fully editables and I can do it manualy  like this :

 

Nikolayev_3-1683209320049.png

 

 

But when it is testcomplete I have this error :

Nikolayev_4-1683209465539.png

 

We tryed severals thing with delay but it not OK

 

 

Can you Help please

 

Thanks 

 

Kinf Regards

 

Nicolas, Nikolayef

 

 

 

16 REPLIES 16

Same Problem with a script

rraghvani
Champion Level 2

Are you able to provide a screenshot of the Object Browser and the properties of that UI control? 

 

here it is :   

Nikolayev_0-1683294992919.png

 

rraghvani
Champion Level 2

Without entering any data in that control, can you take another screenshot with Advanced View - so that we can see all the properties being exposed by the control

 

Like this for example, Object Browser and Properties

rraghvani_0-1683295857548.png

 

eykxas
Frequent Contributor

I don't know if it can help but sometimes, when TC can't set a text I use a little script of my own and doing it in a fully manual way.

 

Click on the field then using this function :

 

function super_typing_keyboard(value){
  var i = 0;
  var lt = value.length;
  
  for (;i < lt; i++){
    var chr = aqString.GetChar(value, i);
    var chrK = Win32API.VkKeyScan(aqString.GetChar(value, i));
    var lowByte = chrK & 255;
    var highByte = (chrK >>  8  ) & 255;
    
    // 1 Either SHIFT key is pressed.
    var shift = highByte & 1;
    // 2 Either CTRL key is pressed.
    var ctrl = highByte & 2;
    //4 Either ALT key is pressed.
    var alt = highByte & 4;
    
    if(shift){
      LLPlayer.KeyDown(VK_SHIFT, 50);
      LLPlayer.KeyDown(lowByte, 50);
      LLPlayer.KeyUp(lowByte, 50);
      LLPlayer.KeyUp(VK_SHIFT, 50);
    }else if(alt){
      LLPlayer.KeyDown(VK_MENU, 50);
      LLPlayer.KeyDown(lowByte, 50);
      LLPlayer.KeyUp(lowByte, 50);
      LLPlayer.KeyUp(VK_MENU, 50);
    }else if(ctrl){
      LLPlayer.KeyDown(VK_CONTROL, 50);
      LLPlayer.KeyDown(lowByte, 50);
      LLPlayer.KeyUp(lowByte, 50);
      LLPlayer.KeyUp(VK_CONTROL, 50);
    }else{
      LLPlayer.KeyDown(lowByte, 50);
      LLPlayer.KeyUp(lowByte, 50);
    }
  }
}

 

 

rraghvani
Champion Level 2

There's a WPF demo application that TestComplete have provided, and the following code works

rraghvani_0-1683297635604.png

Seems like you have to use Click(), followed by the Keys() method.

 

SetText() method did not seem to work for me - also, I don't have the Desktop module license installed

rraghvani_1-1683297766406.png

 

Same Problem with a script

Can you provide actual code that does not work?

Also it might help if you provide test log for this piece of code.

 

Regards,
  /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
================================
cancel
Showing results for 
Search instead for 
Did you mean: