Hi All,

I am a newbie to Watir and Ruby. I  use below function for login
process. As per user's Role Rights the user can navigate to the
permitted pages.  Initially user has to click the main menu, like
admin, master, operation... clicking on the main menu will show
allotted pages names dynamically in OnMouseOver.  then he can click
the page name and navigate to the particular page.

Code

  def login(user_id, password, module_table_id, module_name,
page_table_id, page_name)
    @ie = Watir::IE.new
    @ie.goto $url
    @ie.maximize
    @ie.bring_to_front

    @ie.text_field(:id,"txtUserName").set user_id
    @ie.text_field(:id,"txtPassword").set password
    @ie.button(:id,"btnSubmit").click

    @ie.table(:id,module_table_id).cell(:text,module_name).fire_event
("onMouseOver")
    @ie.table(:id,page_table_id).cell(:text,page_name).click
   end

On the above code "module_table_id" and "page_table_id" will be
changed as per user. I want to modify the function as simple and
reusable. I need it like below.

def login(user_id, password,module_name, page_name)
  #code
end

I used Regular expression in table id but watir failed to identify the
table. so i want to iterate all available tables and check all
available cells finally click the page name cell. So Experts please
throw some light on my request.

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 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to