def checkbox(name, locator)

        # generates method for checking the checkbox object.
        # this will not return any value
        # @example check if 'remember me' checkbox is not checked.
        # checkbox(:remember_me,"xpath~//UICheckBox")
        # DSL to check the 'remember me' check box.
        # def check_remember_me_checkbox
        #   check_remember_me # This method will check the check box.
        # end
        define_method("check_#{name}") do
          ScreenObject::AppElements::CheckBox.new(locator).check
        end

        # generates method for un-checking the checkbox.
        # this will not return any value
        # @example uncheck if 'remember me' check box is checked.
        # DSL to uncheck remember me check box
        # def uncheck_remember_me_check_box
        #   uncheck_remember_me # This method will uncheck the check box if it's checked.
        # end
        define_method("uncheck_#{name}") do
          ScreenObject::AppElements::CheckBox.new(locator).uncheck
        end

        # generates method for checking the existence of object.
        # this will return true or false based on object is displayed or not.
        # @example check if 'remember me' check box exists on the screen.
        # def exist_remember_me_check_box
        #   remember_me? # This method is used to return true or false based on 'remember me' check box exist.
        # end
        define_method("#{name}?") do
          ScreenObject::AppElements::CheckBox.new(locator).exists?
        end

        # generates method for checking if checkbox is already checked.
        # this will return true if checkbox is checked.
        # @example check if 'remember me' check box is not checked.
        # def exist_remember_me_check_box
        #   remember_me? # This method is used to return true or false based on 'remember me' check box exist.
        # end
        define_method("#{name}_checked?") do
          ScreenObject::AppElements::CheckBox.new(locator).checked?
        end

      end
def checkbox(name, locator)

        # generates method for checking the checkbox object.
        # this will not return any value
        # @example check if 'remember me' checkbox is not checked.
        # checkbox(:remember_me,"xpath~//UICheckBox")
        # DSL to check the 'remember me' check box.
        # def check_remember_me_checkbox
        #   check_remember_me # This method will check the check box.
        # end
        define_method("check_#{name}") do
          ScreenObject::AppElements::CheckBox.new(locator).check
        end

        # generates method for un-checking the checkbox.
        # this will not return any value
        # @example uncheck if 'remember me' check box is checked.
        # DSL to uncheck remember me check box
        # def uncheck_remember_me_check_box
        #   uncheck_remember_me # This method will uncheck the check box if it's checked.
        # end
        define_method("uncheck_#{name}") do
          ScreenObject::AppElements::CheckBox.new(locator).uncheck
        end

        # generates method for checking the existence of object.
        # this will return true or false based on object is displayed or not.
        # @example check if 'remember me' check box exists on the screen.
        # def exist_remember_me_check_box
        #   remember_me? # This method is used to return true or false based on 'remember me' check box exist.
        # end
        define_method("#{name}?") do
          ScreenObject::AppElements::CheckBox.new(locator).exists?
        end

        # generates method for checking if checkbox is already checked.
        # this will return true if checkbox is checked.
        # @example check if 'remember me' check box is not checked.
        # def exist_remember_me_check_box
        #   remember_me? # This method is used to return true or false based on 'remember me' check box exist.
        # end
        define_method("#{name}_checked?") do
          ScreenObject::AppElements::CheckBox.new(locator).checked?
        end

      end
end of button class.
 Checkbox class generates all the methods related to different operations that can be performed on the check box on the screen.