Re: [Wtr-general] general questions when trying Watir

2007-07-06 Thread salamond

Hi, zeljko.
Thanks for the reply.

is that what you mean about open a new window?
ie.link(:href,  http://www.google.com ).click
ie2=Watir::IE.attach(url, http://www.google.com;)
then I can use ie2 to drive the new page?

But I find several problems when trying this.
1 ie.link(:href,  http://www.google.com ).click
A new popup window is blocked.
But when I click the link manually, it did open a new window for me.

2 ie2=Watir::IE.attach(:url, http://www.google.com;)
seems it did attach to the window just opened.
But ie2.show_all_objects shows different with IE/view/source.
I can see a table with IE/view/source,
but ie2.show_all_objects didn't show any table.

3 Another question will be igoogle. I add several protelet on my page.
I can't find those links in show_all_objects, but I can use
ie.link(:text, How to of the Day).click to click it.

Is Watir reading the html/view/source to generate the show_all_objects?


thanks
Jarodzz

On 7/5/07, Željko Filipin [EMAIL PROTECTED]  wrote:


Hi Jaordzz,

Comments are inline.

On 7/5/07, salamond [EMAIL PROTECTED] wrote:

 Q1: how do you write your scripts?
 If I want to set my username  passwd in a login form's text_field,
 is there any other way except for dig into the html to see what the name
 of text_filed is?


I use Firebug ( https://addons.mozilla.org/en-US/firefox/addon/1843) for
Firefox, but there is also Internet Explorer Developer Toolbar (
http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038displaylang=en
)

Q2: Working with Ajax sometimes, I can't even find the object in
 VIEW/source.
 does watir support Ajax testing? will it work with several web sites
 like igoogle or liferay?


Yes. If you have a problem with something, let us know.

Q3: I can't have attach work properly for me.
 if i got a link like this :

 a href=

 http://www.google.com; target=_blank.
 and ie is my current page driver.
 ie2= Watir::IE.attach(:url,'

 http://www.google.com' http://www.google.com%27)
 if i did this, will the link in ie be clicked and a new window generated?

 Try this.

ie.link(:href,  http://www.google.com ).click

Zeljko

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] general questions when trying Watir

2007-07-06 Thread Željko Filipin

Hi Jarodzz,

Comments are inline (again).

On 7/6/07, salamond [EMAIL PROTECTED] wrote:


A new popup window is blocked.



Disable all pop-up blockers that you have installed.

Is Watir reading the html/view/source to generate the show_all_objects?


I do not use show_all_objects. As far as I understood, it's use is
discouraged. You should use Firebug for Firefox or Internet Explorer
Developer Toolbar. Inspecting HTML can help too.

Zeljko
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] general questions when trying Watir

2007-07-06 Thread hhwwpssp
 3 Another question will be igoogle. I add several protelet on my page.
 I can't find those links in show_all_objects, but I can use
 ie.link(:text, How to of the Day).click to click it.

 Is Watir reading the html/view/source to generate the show_all_objects?

No.  The method accesses all elements in the document object model,
and in fact all the links in a page are included in its output.
They're the ones that look like this:

  name=   id=

Which is obviously not very helpful.  The problem is that
show_all_objects prints a specific list of properties that aren't good
for distinguishing links.

You could try hacking the method to show more properties, or something like:

ie.links.each do | link |
  puts link text: #{link.text}\thref=#{link.href}
end
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general