mattyd 89 Posting Maven Featured Poster

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:

1  require 'watir'
2  ie = Watir::IE.new
3  ie.maximize
4  ie.goto(')

#ie warning page bypass
5  ie.link(:text, "Continue to this website (not recommended).").click

#remote login set
6  ie.text_field(:name, "who").set("tom")
7  ie.text_field(:name, "who1").set("smith")
8  ie.text_field(:name, "what1").set("main site")
9  ie.text_field(:name, "when1").set("today")
10 ie.button(:value, "go").click

#primary login set
11 ie.text_field(:name, "nickname").set("bluejay")
12 ie.text_field(:name, "password").set("password1")
13 ie.button(:value, "Login").click

#select link to continue to User account creation
14 ie.link(:text, 'OA Management').click

----------------
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):

<!-- Registration table -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="menuboxheaderL">Manage Registration</td>
<td class="menuboxheaderR">&nbsp;</td>
</tr>
<tr>
<td class="menuboxline" colspan="2"><img src="images/spacer.gif" alt=""
width="1" height="3"></td>
</tr>
<tr>
<td class="menuboxbody" colspan="2">
<ul class="menuboxlist">
<li><a href="dev/setup_premain.asp?qyz=xGfkTgWcUOQVYblhJkG">OA
Management</a></li>

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

Thank-you in advance for any help or hints.

Regards,
Matty D.

Dani AI

Generated

— a few targeted checks will usually find why a Watir/IE script can authenticate but then fail to activate a navigation link.

First, run a quick DOM inspection with IE Developer Tools while logged in manually. Confirm the clickable thing is really an anchor (or a clickable element driven by JavaScript), and check whether it sits inside a frame/iframe or is created dynamically after page load. Next, reproduce the click by hand and watch for dialogs, popups or new windows; those will change the automation context and stop a simple click from working. Also look for hidden characters or extra whitespace in the visible label (these break exact-text locators).

A small troubleshooting checklist:

  • Use the browser DOM inspector to verify element type, parent frame, and any onclick handlers.
  • If the element is in a frame/iframe, target the frame first.
  • If the label contains extra spaces or non-breaking spaces, use a regex or an href-based locator instead of an exact-text match.
  • Wait for the element to be present/visible before clicking; dynamic pages often need an explicit wait.
  • If the link opens a new window, switch to that window before interacting further.
  • As a last resort, trigger the click via the element’s JS handler (fire_event/execute_script) if the normal click is ignored.

Example approaches (generic placeholders):

browser.frame(id: 'frame_id').link(href: /some_path/).wait_until(&:present?).click
# or fall back to JavaScript click if needed
browser.execute_script('arguments[0].click()', element)

For implementation details and reliable locator/wait patterns consult the official Watir guides on locators, waiting, and frames: , , . Avoid embedding real credentials in scripts and test automation flows against safe test accounts.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.