# encoding: utf-8
require 'rubygems'
require 'watir-webdriver'
module CWrap
    def ???(obj)
        obj.click rescue obj.class.to_s + '??????????е??'
    end
    def ???????()
        self
    end
    alias :?? :???????
    alias :?? :??
    alias :??? :??
    def ??(obj)
        obj
    end
    def ???(obj)
        obj.wait_until_present rescue puts('??' + obj.class.to_s + '??????????е??????')
    end
    def ???(obj)
        obj.close rescue puts('?????????' + obj.class.to_s + '????')
    end
    def ????(text)
        self.set text rescue puts('???' + self.class.to_s + '???????????????')
    end
    def ???(url)
        self.goto url rescue puts(self.class.to_s + '??????????????????')
    end
    def ????(text)
        self.include? text rescue puts self.class.to_s + '??????????а???????'
    end
    def ????(text)
        puts text
    end
end
include CWrap

????????? = Watir::Browser.new :firefox
?????????.??? 'www.google.com'
??(?????????.??.text_field(:name?? "q")).??.???? "qq"
??? ?????????.??.button(:name?? "btnG")
???(?????????.??.div(:id?? "resultStats"))
???? '???????' if ?????????.??.text.????('???QQ')
??? ?????????