943,766 Members | Top Members by Rank

Ad:
  • Ruby Discussion Thread
  • Unsolved
  • Views: 3058
  • Ruby RSS
May 24th, 2008
0

Accessing URL Links

Expand Post »
I am a member of a QA/testing team for a software company in NYC. We
have decided recently to begin the development of scripting tools to
automate repetitive tasks used during our testing cycles. We have
decided to use Ruby. Although we have admired Ruby from afar for some
time now we have yet to actually make use of it.

So far we are coding simple scripts to create user accounts for testing;
this activity always absorbs incredible amounts of time and interrupts
our testing procedures, hence the need for automation.

What we have created in Ruby the last few days has been very exciting
and it convinces us of the power and beauty of this language.

Working remotely from home today on this project I have been attempting
to access the backend Admin controls for the company/site, that is, I'm
developing a script to automate this process in order for "users" to be
created for our upcoming testing cycle purposes.

This process is straight-foward: logging in via a two-step process to
ensure security. The script is simple and works up unto the point that
I must actually select a link to continue further (after log-in).

The following code is an anonymous version of the actual code I am using
(real links, passwords, etc altered:

Ruby Syntax (Toggle Plain Text)
  1. 1 require 'watir'
  2. 2 ie = Watir::IE.new
  3. 3 ie.maximize
  4. 4 ie.goto('https://main2.site.org/dev/code.asp)
  5.  
  6. #ie warning page bypass
  7. 5 ie.link(:text, "Continue to this website (not recommended).").click
  8.  
  9. #remote login set
  10. 6 ie.text_field(:name, "who").set("tom")
  11. 7 ie.text_field(:name, "who1").set("smith")
  12. 8 ie.text_field(:name, "what1").set("main site")
  13. 9 ie.text_field(:name, "when1").set("today")
  14. 10 ie.button(:value, "go").click
  15.  
  16. #primary login set
  17. 11 ie.text_field(:name, "nickname").set("bluejay")
  18. 12 ie.text_field(:name, "password").set("password1")
  19. 13 ie.button(:value, "Login").click
  20.  
  21. #select link to continue to User account creation
  22. 14 ie.link(:text, 'OA Management').click
  23.  
----------------
Line 14 of the above code is where I am stuck; I have tried many
variations of activating the link ('OA Management' being the string
available in the code I'm referencing). I have researched the different
methods all day but with no results.
----------------

The following snippet is source code indicating the link(last <li>
line):
Ruby Syntax (Toggle Plain Text)
  1. <!-- Registration table -->
  2. <table cellpadding="0" cellspacing="0" border="0" width="100%">
  3. <tr>
  4. <td class="menuboxheaderL">Manage Registration</td>
  5. <td class="menuboxheaderR">&nbsp;</td>
  6. </tr>
  7. <tr>
  8. <td class="menuboxline" colspan="2"><img src="images/spacer.gif" alt=""
  9. width="1" height="3"></td>
  10. </tr>
  11. <tr>
  12. <td class="menuboxbody" colspan="2">
  13. <ul class="menuboxlist">
  14. <li><a href="dev/setup_premain.asp?qyz=xGfkTgWcUOQVYblhJkG">OA
  15. Management</a></li>

---------------

Thank-you in advance for any help or hints.

Regards,
Matty D.
Similar Threads
Featured Poster
Reputation Points: 105
Solved Threads: 1
Posting Maven
mattyd is offline Offline
2,582 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Ruby Forum Timeline: f.check_box help
Next Thread in Ruby Forum Timeline: help in watir





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC