| || |
One of my java method requires an object to be passed as its parameter.
In the process of selecting an item of a list, I am forced to call the combobox.setselecteditem(object). This object is of type java.lang.object.
How will I pass this object to java method from my testcomplete code. Actually I have string to be passed, how will type cast the string to the target type.
[ 05-10-2004, 11:52 PM: Message edited by: Umakanth_SQA ]
Our support team will contact you regarding this problem.
We are doing Test Complete connected Application with C#,
problem is when we use test complete code in visual studio we have to assign all variables as var since we are using test complete script which has square brackets (if we don't use var it will consider this as index).
Now we want to convert this var to string ,int as we use a method which takes int.
Question is How to cast var to int or string in Visual studio
var taslFieldType = Sys["Process"]("WINTPS")["frmClientSetup"]["PnlViewingArea"]["PnlTASL"]["PnlShowPanel"]["ScrlbxShowBox"]["TaxInputPanel1"]["CurControl"]["TaslFieldType"];
output of taslFieldType is integer (0-20)
then we want to use switch statement
but we get exception taslFieldType is not an integer when we run visual studio.
var XYZ = new var ((string)current Control[ABC]);
but that doesn't work.
Any suggestions will be helpful
To make this switch statement work, you need to explicitly convert the taslFieldType variable to int:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> switch((int)taslFieldType)
....</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Atanas
Thanks for replying,
we tried that but it didn't worked, we get exception in visual studio
specified cast is not valid.
Any other idea
Try using this typecast: switch ((System.Int16)t)
System.int16 didnt worked
but System.Uint16 worked