Logo QF-Test

Finding valuable answers
in the Mailing List Archive.

 

Free Trial  Download  Buy

Thomas Max, QF-Test training and support

Use the full-text search on our web site to find helpful tips on the mailing list.

Thomas Max, 
Sr. Software Engineer & Trainer, QFS

2016 up to now | 2015 | 2014 | 2013 | 2012 | 2011 | 2010 | 2009 | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

Mailing List - Entries of 2007


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[QF-Test] Help required to typecast String to List in SUT Script


  • Subject: [QF-Test] Help required to typecast String to List in SUT Script
  • From: "Alfred Mathavan" <amathava@?.com>
  • Date: Fri, 11 May 2007 02:51:13 -0600

Hi All,

 

I have configured JYDT (Jython Development Tool) in eclipse v3.2

Click here -> http://www.redrobinsoftware.net/jydt/ for more information on JYDT.

 

After Configuration of JYDT in Eclipse I am able to develop and execute Jython programs in Eclipse IDE.

 

For E.g.:

IPList='172.31.11.181','172.26.20.158','172.31.11.184','172.31.11.200','172.31.11.186','172.31.11.183',

print type(IPList)

print IPList

 

list=list(IPList)

print len(list)

print list

 

Output:

<type 'tuple'>

('172.31.11.181', '172.26.20.158', '172.31.11.184', '172.31.11.200', '172.31.11.186', '172.31.11.183')

6

['172.31.11.181', '172.26.20.158', '172.31.11.184', '172.31.11.200', '172.31.11.186', '172.31.11.183']

 

When I try to get the same with QF-Test SUT Script with a slight change in the IPList variable type I goof up.

I am not sure how to typecast a String variable to a tuple (or) List.

 

In QFTest I have a variable called globalList with the value '172.31.11.181','172.26.20.158','172.31.11.184','172.31.11.200','172.31.11.186','172.31.11.183',

 

I try to get the same output that I got in Eclipse from my SUT Script.

 

The 2 approaches that I tried are:-

Approach 1

IPList=globalList

print type(IPList)

print IPList

 

list=list(IPList)

print len(list)

print list

Output 1

org.python.core.PyString

'172.31.11.181','172.26.20.158','172.31.11.184','172.31.11.200','172.31.11.186','173.34.3.3','172.31.11.183',

109

["'", '1', '7', '2', '.', '3', '1', '.', '1', '1', '.', '1', '8', '1', "'", ',', "'", '1', '7', '2', '.', '2', '6', '.', '2', '0', '.', '1', '5', '8', "'", ',', "'", '1', '7', '2', '.', '3', '1', '.', '1', '1', '.', '1', '8', '4', "'", ',', "'", '1', '7', '2', '.', '3', '1', '.', '1', '1', '.', '2', '0', '0', "'", ',', "'", '1', '7', '2', '.', '3', '1', '.', '1', '1', '.', '1', '8', '6', "'", ',', "'", '1', '7', '3', '.', '3', '4', '.', '3', '.', '3', "'", ',', "'", '1', '7', '2', '.', '3', '1', '.', '1', '1', '.', '1', '8', '3', "'", ',']

 

 

Approach 2

            IPList=[globalList]

print type(IPList)

print IPList

 

list=list(IPList)

print len(list)

print list

Output 2

org.python.core.PyList

["'172.31.11.181','172.26.20.158','172.31.11.184','172.31.11.200','172.31.11.186','173.34.3.3','172.31.11.183',"]

1

["'172.31.11.181','172.26.20.158','172.31.11.184','172.31.11.200','172.31.11.186','173.34.3.3','172.31.11.183',"]

 

Any help to get the exact list from the SUT Script?

 

Greetings,

Alfred

 

 


Videos Downloads Documentation Buy Free Trial