ldtp / ldtp2

Linux Desktop Testing Project
GNU Lesser General Public License v2.1
108 stars 49 forks source link

enterstring method does not work with "<" character #41

Open codeNameMahi opened 7 years ago

codeNameMahi commented 7 years ago

I am unable to input the "<" character using the enterstring method:

>>> ldtp.enterstring("frmWindow", "txtField", ">") 1

>>> ldtp.enterstring("frmWindow", "txtField", "<") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/ldtp/client.py", line 70, in __call__ return self.__send(self.__name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request verbose=self.__verbose File "/usr/lib/python2.7/dist-packages/ldtp/client.py", line 187, in request raise e xmlrpclib.Fault: <Fault 8002: 'string index out of range'>

(all special characters minus "<") >>> ldtp.enterstring("frmWindow", "txtField", "~!@#$%^&*()_+=-,./?[]{}|") 1

(now including "<") >>> ldtp.enterstring("frmWindow", "txtField", "~!@#$%^&*()_+=-,./?[]{}|<>") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/ldtp/client.py", line 70, in __call__ return self.__send(self.__name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request verbose=self.__verbose File "/usr/lib/python2.7/dist-packages/ldtp/client.py", line 187, in request raise e xmlrpclib.Fault: <Fault 8002: "'KeyComboAction' object has no attribute '_func'">

stuaxo commented 5 years ago

Bit of a guess. but since this is using XMLRPC underneath it could be worth experimenting with things that might work in XML ?

&lt; &#60;

Or construct it using CDATA <![CDATA[<]]>

(Though some of these might get eaten by the special character code)

https://www.dvteclipse.com/documentation/svlinter/How_to_use_special_characters_in_XML.3F.html

You can use a CDATA section to avoid content being parsed by the parser. https://stackoverflow.com/a/16958735/62709