Getting error undefined method << for nilClass

14 views
Skip to first unread message

Mike Colvin

unread,
Feb 15, 2016, 7:20:55 PM2/15/16
to selenium-ruby
I am really struggling with this but probably very simple for ruby programmer.

I am trying to verify a value in a webpage:

wait_for {is_displayed? MASTER}
    click GLOBAL
    wait_for {is_displayed? ACRECEIVABLE}
    click ACRECEIVABLE
    wait_for {is_displayed? AR01}
    click AR01
    click AR1001
    puts AR1001TOTALAMT
    puts AR1001ROW
    totalcount = '2,139.471.00'
    rowtest = '986'
    wait_for { @driver.find_element(:xpath, "//table[@id='rt_NS_']/tbody/tr[2]/td/table/tbody/tr/td/span") }
    verify {(@driver.find_element(:xpath, "//table[@id='rt_NS_']/tbody/tr[2]/td/table/tbody/tr[2]/td/table/tbody/tr/td[2]/span").text).should == "2,139.471.00"}    <--------- This line works perfectly!
    verify { (@driver.find_element(:xpath, "//table[@id='rt_NS_']/tbody/tr[2]/td/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span").text).should == totalcount }     <--------- Same element but trying to pass variable
    verify { (@driver.find_element(:xpath, "//table[@id='rt_NS_']/tbody/tr[2]/td/table/tbody/tr[2]/td/table/tbody/tr/td[2]/span").text).should == "986" }               <--------- This line works perfectly!
    verify { (@driver.find_element(:xpath, "//table[@id='rt_NS_']/tbody/tr[2]/td/table/tbody/tr[2]/td/table/tbody/tr/td[2]/span").text).should == rowtest }            <--------- Same element but trying to pass variable
    wait_for { @driver.find_element(:xpath, "//table[@id='rt_NS_']/tbody/tr[2]/td/table/tbody/tr/td/span") }



Any help would be appreciated.


Mike Colvin

unread,
Feb 16, 2016, 2:20:41 PM2/16/16
to selenium-ruby
OK Found the issue and resolved
Reply all
Reply to author
Forward
0 new messages