PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > Accessing URL links inside of Tables
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Accessing URL links inside of Tables

Réponse
 
LinkBack Outils de la discussion
Vieux 24/05/2008, 22h20   #1
Matty Diefs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Accessing URL links inside of Tables

Hello:

This is my first post in this forum.

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('https://main2.site.org/dev/code.asp)

#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 or hints.

Regards,
Matty D.
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 24/05/2008, 23h07   #2
Phlip
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Accessing URL links inside of Tables

> 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.


What language is your program's source in?

Are your developers writing unit tests, in that language? or are they
spending all their time debugging?

To them write unit tests, you should write automated tests in the same
language as they are using.


  Réponse avec citation
Vieux 25/05/2008, 15h41   #3
Axel Etzold
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Accessing URL links inside of Tables


-------- Original-Nachricht --------
> Datum: Sun, 25 May 2008 06:20:48 +0900
> Von: Matty Diefs <neudev@gmail.com>
> An: ruby-talk@ruby-lang.org
> Betreff: Accessing URL links inside of Tables


> Hello:
>
> This is my first post in this forum.
>
> 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('https://main2.site.org/dev/code.asp)
>
> #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.
> ----------------



Hello Matty,

unfortunately, I can't you with Watir, as it's Windows-specific,
but have you looked at ---

Mechanize ttp://mechanize.rubyforge.org/mechanize/
Rubyful Soup http://www.crummy.com/software/RubyfulSoup/

or, for Windows-software button-clicking :

AutoIT (that's not Ruby, but nice anyway) http://www.autoitscript.com/autoit3/

Best regards,

Axel



>
> 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 or hints.
>
> Regards,
> Matty D.
> --
> Posted via http://www.ruby-forum.com/.


--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

  Réponse avec citation
Vieux 25/05/2008, 15h48   #4
Matty Diefs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Accessing URL links inside of Tables

Axel Etzold wrote:
> -------- Original-Nachricht --------
>> Datum: Sun, 25 May 2008 06:20:48 +0900
>> Von: Matty Diefs <neudev@gmail.com>
>> An: ruby-talk@ruby-lang.org
>> Betreff: Accessing URL links inside of Tables

>
>> So far we are coding simple scripts to create user accounts for testing;
>>
>> 3 ie.maximize
>> 10 ie.button(:value, "go").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.
>> ----------------

>
>
> Hello Matty,
>
> unfortunately, I can't you with Watir, as it's Windows-specific,
> but have you looked at ---
>
> Mechanize ttp://mechanize.rubyforge.org/mechanize/
> Rubyful Soup http://www.crummy.com/software/RubyfulSoup/
>
> or, for Windows-software button-clicking :
>
> AutoIT (that's not Ruby, but nice anyway)
> http://www.autoitscript.com/autoit3/
>
> Best regards,
>
> Axel


Axel:

Thank-you very much for your reply and suggestions.

Regards,
Matty
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h59.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,16673 seconds with 12 queries