watir and ruby for web based application testing

Discussion in 'Ruby' started by cjdgmed, Jun 15, 2012.

  1. cjdgmed

    cjdgmed Guest

    i am new in watir and ruby and i need to test a web based application with a use of excel wherein all the inputs are stored there. theres a registration form in the application and all the inputs in the given fields are in anexcel file. what will my code be like?

    my code here is not working. i also use notepad++ for coding and command prompt to run the program

    require 'watir-webdriver'
    require 'parseexcel'

    browser = Watir::Browser.new :chrome
    browser.goto 'website'
    browser.button:)name => 'ctl00$ContentPlaceHolder1$btnRegister').click

    workbook = Spreadsheet::parseExcel.parse(ARGV[0])

    worksheet = workbook.worksheet(0)

    worksheet.each { |row|
    i=0
    j=0
    if row != nil
    row.each { |cell|
    if cell != nil
    contents = cell.to_s('latin1')
    puts "Row: #{j} Cell: #{i} #{contents}"
    end
    #i = i+1

    }
    j = j +1
    end
    }


    hope you could help me... thanks! :)
     
    cjdgmed, Jun 15, 2012
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.