[wtr-general] Re: operator not working

2008-12-02 Thread Prince3105

Hi Friends,

I got the solution, when i run the code it returns the TableCell only
not the string. Then i modified the code as below
and works well.

real = ie.frame(:id,wfFrame).table
(:id,lkpTradingPartnerType_LkpTblRows) [2] [1]
list  = ie.frame(:id,wfFrame).table
(:id,lkpTradingPartnerType_LkpTblRows) [3] [1]

if real.to_s == AO  list.to_s == HQ
  puts real
  puts list
  puts Pass
  else
putsFail
puts real
puts list
  end

Thanks,
Prince3105


On Dec 2, 2:01 pm, Prince3105 [EMAIL PROTECTED] wrote:
 Thanks for your reply, When i use first method it returns,

 'AO'
 'HQ'

 When i use length method it returns one error

 ADM0005.rb:20: undefined method `length' for #Watir::TableCell:
 0x41bc250 (NoMethodError)

 But i insert one code below like

 a = abcd
 puts a.length

 it returns the correct answer 4. Totally i confused.. Please post a
 positive way..

 Thanks,
 Prince3105

 On Dec 2, 1:09 pm, LFIdnl [EMAIL PROTECTED] wrote:

  Or you can execute puts real.length; puts list.length . That shows you
  what the length of stings

  On 2 дек, 11:07, LFIdnl [EMAIL PROTECTED] wrote:

   May be your variable 'real' and 'list' have another not visible
   character like as whitespace. Try exucuite puts '#{real}'; puts '#
   {list}' . Result should be in apostrophies.

   On 2 дек, 10:12, Prince3105 [EMAIL PROTECTED] wrote:

Hi Experts,

I am totally new to Ruby and Watir. Before i was using QTP with
VBscript. Today i have encountered a various problem. I have used
below code to retrieve cell value from a table then i have to check
these values with the actual value.

version
Ruby  - 1.8.6-26 Final Release
Watir  - Watir 1.6.0

real = ie.frame(:id,wfFrame).table
(:id,lkpTradingPartnerType_LkpTblRows) [2] [1]
list  = ie.frame(:id,wfFrame).table
(:id,lkpTradingPartnerType_LkpTblRows) [3] [1]

puts real
puts list

if real == AO  list == HQ
   puts real
   puts list
   puts Pass
else
    putsFail
    puts real
    puts list
end

Test gets fail and i wondering about below result.

ruby ADM0005.rb

AO
HQ
Fail
AO
HQ

Exit code: 0

If any error on my code please let me know, if any other easy and
effective way available please reply.

Thanks,

Prince3105
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: operator not working

2008-12-02 Thread LFIdnl

Or you can execute puts real.length; puts list.length . That shows you
what the length of stings

On 2 дек, 11:07, LFIdnl [EMAIL PROTECTED] wrote:
 May be your variable 'real' and 'list' have another not visible
 character like as whitespace. Try exucuite puts '#{real}'; puts '#
 {list}' . Result should be in apostrophies.

 On 2 дек, 10:12, Prince3105 [EMAIL PROTECTED] wrote:

  Hi Experts,

  I am totally new to Ruby and Watir. Before i was using QTP with
  VBscript. Today i have encountered a various problem. I have used
  below code to retrieve cell value from a table then i have to check
  these values with the actual value.

  version
  Ruby  - 1.8.6-26 Final Release
  Watir  - Watir 1.6.0

  real = ie.frame(:id,wfFrame).table
  (:id,lkpTradingPartnerType_LkpTblRows) [2] [1]
  list  = ie.frame(:id,wfFrame).table
  (:id,lkpTradingPartnerType_LkpTblRows) [3] [1]

  puts real
  puts list

  if real == AO  list == HQ
     puts real
     puts list
     puts Pass
  else
      putsFail
      puts real
      puts list
  end

  Test gets fail and i wondering about below result.

  ruby ADM0005.rb

  AO
  HQ
  Fail
  AO
  HQ

  Exit code: 0

  If any error on my code please let me know, if any other easy and
  effective way available please reply.

  Thanks,

  Prince3105
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: operator not working

2008-12-02 Thread Prince3105

Thanks Tony for your solution, it works...


Thanks,
Prince3105

On Dec 2, 2:34 pm, Prince3105 [EMAIL PROTECTED] wrote:
 Hi Friends,

 I got the solution, when i run the code it returns the TableCell only
 not the string. Then i modified the code as below
 and works well.

 real = ie.frame(:id,wfFrame).table
 (:id,lkpTradingPartnerType_LkpTblRows) [2] [1]
 list  = ie.frame(:id,wfFrame).table
 (:id,lkpTradingPartnerType_LkpTblRows) [3] [1]

 if real.to_s == AO  list.to_s == HQ
   puts real
   puts list
   puts Pass
   else
     putsFail
     puts real
     puts list
   end

 Thanks,
 Prince3105

 On Dec 2, 2:01 pm, Prince3105 [EMAIL PROTECTED] wrote:

  Thanks for your reply, When i use first method it returns,

  'AO'
  'HQ'

  When i use length method it returns one error

  ADM0005.rb:20: undefined method `length' for #Watir::TableCell:
  0x41bc250 (NoMethodError)

  But i insert one code below like

  a = abcd
  puts a.length

  it returns the correct answer 4. Totally i confused.. Please post a
  positive way..

  Thanks,
  Prince3105

  On Dec 2, 1:09 pm, LFIdnl [EMAIL PROTECTED] wrote:

   Or you can execute puts real.length; puts list.length . That shows you
   what the length of stings

   On 2 дек, 11:07, LFIdnl [EMAIL PROTECTED] wrote:

May be your variable 'real' and 'list' have another not visible
character like as whitespace. Try exucuite puts '#{real}'; puts '#
{list}' . Result should be in apostrophies.

On 2 дек, 10:12, Prince3105 [EMAIL PROTECTED] wrote:

 Hi Experts,

 I am totally new to Ruby and Watir. Before i was using QTP with
 VBscript. Today i have encountered a various problem. I have used
 below code to retrieve cell value from a table then i have to check
 these values with the actual value.

 version
 Ruby  - 1.8.6-26 Final Release
 Watir  - Watir 1.6.0

 real = ie.frame(:id,wfFrame).table
 (:id,lkpTradingPartnerType_LkpTblRows) [2] [1]
 list  = ie.frame(:id,wfFrame).table
 (:id,lkpTradingPartnerType_LkpTblRows) [3] [1]

 puts real
 puts list

 if real == AO  list == HQ
    puts real
    puts list
    puts Pass
 else
     putsFail
     puts real
     puts list
 end

 Test gets fail and i wondering about below result.

 ruby ADM0005.rb

 AO
 HQ
 Fail
 AO
 HQ

 Exit code: 0

 If any error on my code please let me know, if any other easy and
 effective way available please reply.

 Thanks,

 Prince3105
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: operator not working

2008-12-02 Thread Prince3105

Thanks for your reply, When i use first method it returns,

'AO'
'HQ'

When i use length method it returns one error

ADM0005.rb:20: undefined method `length' for #Watir::TableCell:
0x41bc250 (NoMethodError)


But i insert one code below like

a = abcd
puts a.length

it returns the correct answer 4. Totally i confused.. Please post a
positive way..


Thanks,
Prince3105



On Dec 2, 1:09 pm, LFIdnl [EMAIL PROTECTED] wrote:
 Or you can execute puts real.length; puts list.length . That shows you
 what the length of stings

 On 2 дек, 11:07, LFIdnl [EMAIL PROTECTED] wrote:

  May be your variable 'real' and 'list' have another not visible
  character like as whitespace. Try exucuite puts '#{real}'; puts '#
  {list}' . Result should be in apostrophies.

  On 2 дек, 10:12, Prince3105 [EMAIL PROTECTED] wrote:

   Hi Experts,

   I am totally new to Ruby and Watir. Before i was using QTP with
   VBscript. Today i have encountered a various problem. I have used
   below code to retrieve cell value from a table then i have to check
   these values with the actual value.

   version
   Ruby  - 1.8.6-26 Final Release
   Watir  - Watir 1.6.0

   real = ie.frame(:id,wfFrame).table
   (:id,lkpTradingPartnerType_LkpTblRows) [2] [1]
   list  = ie.frame(:id,wfFrame).table
   (:id,lkpTradingPartnerType_LkpTblRows) [3] [1]

   puts real
   puts list

   if real == AO  list == HQ
      puts real
      puts list
      puts Pass
   else
       putsFail
       puts real
       puts list
   end

   Test gets fail and i wondering about below result.

   ruby ADM0005.rb

   AO
   HQ
   Fail
   AO
   HQ

   Exit code: 0

   If any error on my code please let me know, if any other easy and
   effective way available please reply.

   Thanks,

   Prince3105
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: operator not working

2008-12-02 Thread Tony

Hi,

Got the error -
real = ie.frame(:id,wfFrame).table
(:id,lkpTradingPartnerType_LkpTblRows) [2] [1]
The above statement returns an object of Watir::TableCell and the
length for this will not be the string length.
Maybe the == also is not working due to this.

Do the below
real = ie.frame(:id,wfFrame).table
(:id,lkpTradingPartnerType_LkpTblRows) [2] [1].to_s
list  = ie.frame(:id,wfFrame).table
(:id,lkpTradingPartnerType_LkpTblRows) [3] [1].to_s

to_s will convert to a string and this should compare properly.

-Tony

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---