Forum: Ruby how to open pop up window table?

Posted by Love U Ruby (my-ruby)
on 2013-01-10 13:04
There is `text label` on a webpage, and I am trying to click on that to
open a pop-up window,but not getting opened. here is the `HTML` code:

  <td width="40%">
    <div id="EmpId.outline">
    <input type="hidden" name="EmpId" value="" id="popupEmpId">
    <input type="text" name="EmpCode" value="" readonly="readonly"
class="textMedium250" id="popupEmpCode" autocomplete="off">&nbsp;<a
href="#f2"><label  onclick="checkForPopup('EmpPopupDiv','Select a
Emp',640,true,refreshConditionOptions);">&nbsp;+&nbsp;Search&nbsp;for&nbsp;a&nbsp;Emp</label>
</a>
     </div>
  </td>

I have to click on the field `+ Search for a Emp`, but could not do
that.
Posted by Joel Pearson (virtuoso)
on 2013-01-10 15:02
What tool are you using to do the clicking?
Can you share the relevant code you're running?
Posted by Love U Ruby (my-ruby)
on 2013-01-10 15:10
Joel Pearson wrote in post #1091766:
> What tool are you using to do the clicking?
> Can you share the relevant code you're running?


Hi Joel,

I am using Selenium with Ruby 1.9.3. But for that Popup window to open,I 
am confused what should I write?how to code that, as the level is 
totally nested.
Posted by Love U Ruby (my-ruby)
on 2013-01-10 16:07
Attachment: Screenshot.docx (204 KB)
Hi,

I just uploaded one screenshot. Please look into that,which might help 
you people what exactly I am looking for.


Thanks,
Posted by Joel Pearson (virtuoso)
on 2013-01-10 17:24
I'm not particularly experienced with Selenium without Watir, but I 
should think that you want to click on the link rather than the text.

Something along the lines of:

.link(:href => "#f2").click

or

.div(:id => "EmpId.outline").link(:index => 1).fire_event("onclick")

Without you showing your nearby code it'll be difficult to know what 
objects you're dealing with, so I don't know the naming conventions 
you're using.
Posted by Love U Ruby (my-ruby)
on 2013-01-10 18:58
Joel Pearson wrote in post #1091802:
> I'm not particularly experienced with Selenium without Watir, but I
> should think that you want to click on the link rather than the text.
>
> Something along the lines of:
>
> .link(:href => "#f2").click
>
> or
>
> .div(:id => "EmpId.outline").link(:index => 1).fire_event("onclick")
>
> Without you showing your nearby code it'll be difficult to know what
> objects you're dealing with, so I don't know the naming conventions
> you're using.


Does "Watir" support Firefox 17.0.1? I was using selenium-webdriver to
automate webpage form filling.

If Watir support Latest version of Firefox I can think about that. But i
think Selenium is much faster than `Watir`.
Posted by Joel Pearson (virtuoso)
on 2013-01-10 20:17
Watir-webdriver is Selenium with Watir's API, I consider it the best of 
both worlds. The latest version does support Firefox 17.0.1.
Posted by Love U Ruby (my-ruby)
on 2013-01-10 20:21
Joel Pearson wrote in post #1091811:
> Watir-webdriver is Selenium with Watir's API, I consider it the best of
> both worlds. The latest version does support Firefox 17.0.1.


Can you suggest me what gem I need to install to work with lates version 
of Firefox and proper documentation. Does FireWatir support all kind of 
webelement handling like Selenium Webdriver?


Really interested to work with FireWatir if my question's answers are 
yes.

Thanks
Posted by Joel Pearson (virtuoso)
on 2013-01-10 22:49
This should help you understand a bit more and give you something to get
started with: http://watirwebdriver.com/

I think the graph on this page is a great way of explaining the 
relationship between these different browser automation tools :)
http://watirmelon.com/2010/04/10/watir-selenium-webdriver/
Posted by Joel Pearson (virtuoso)
on 2013-01-11 11:58
Since you mentioned Firefox specifically:

http://watirwebdriver.com/firefox/

Also, if you don't have Firebug, get it ASAP. It will make your life 
much easier when identifying elements.

https://addons.mozilla.org/en-US/firefox/addon/firebug/
Posted by Love U Ruby (my-ruby)
on 2013-01-11 12:42
Joel Pearson wrote in post #1091888:
> Since you mentioned Firefox specifically:
>
> http://watirwebdriver.com/firefox/
>
> Also, if you don't have Firebug, get it ASAP. It will make your life
> much easier when identifying elements.
>
> https://addons.mozilla.org/en-US/firefox/addon/firebug/

Thanks for your continuous help! Would you suggest me any good gem for 
File
handling using Ruby,not the "stdlib". Specially to deal with
".txt,.xlsx,.csv" files.
Posted by Joel Pearson (virtuoso)
on 2013-01-11 13:09
Ruby can handle .txt files fine just using "File". I found a few simple 
examples here: http://progzoo.net/wiki/Ruby:Read_a_Text_File

I personally use the "win32ole" excel.application object invisibly to 
handle xlsx files. I did try "roo" and "spreadsheet" gems, but it's so 
much easier for me to interact directly with excel as I'm already 
familiar with all the commands.
There's a walkthrough here that looks alright: 
http://davidsulc.com/blog/2011/03/27/win32ole-and-...


I've never worked with CSVs, but I think there's a good CSV gem 
available or you could use "File" and handle the parsing yourself. This 
link looks fairly useful: 
http://snippets.aktagon.com/snippets/246-How-to-pa...
Posted by unknown (Guest)
on 2013-01-11 17:51
(Received via mailing list)
Am 11.01.2013 13:09, schrieb Joel Pearson:
> I've never worked with CSVs, but I think there's a good CSV gem
> available or you could use "File" and handle the parsing yourself. This
> link looks fairly useful:
> http://snippets.aktagon.com/snippets/246-How-to-pa...

Use the built-in CSV class.

The link is out-dated. In Ruby 1.9 the CSV implementation has
been replaced by FasterCSV, so there is no need to require the gem.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.