[wtr-general] table row_count incorrect

2008-10-23 Thread Paul Denize
The following watir code is enough to demonstrate the flaw in the row_count method. The table has 2 rows - but watir return 6. The problem is tables embedded in tables and the rowcount simply counting TR tags from the outside. Therefore it counts inner table rows as well Code can then fail

[wtr-general] Re: table row_count incorrect

2008-10-23 Thread Paul Denize
This is not the only routine and while digging I found comments like # This method returns the table as a 2 dimensional array. Dont expect too much if there are nested tables, colspan etc. All the routines seem to use the following process rows = table object.getElementsByTagName(TR).length

[wtr-general] Re: table row_count incorrect

2008-10-23 Thread Paul Denize
Overloading the following seems to get past the limitations. Perhaps someone with more DOM experience can comment if there are any dangers One thin I did notice is that it picks up TH data cells just like TD ones class Table def row_count assert_exists return

[wtr-general] Re: Turning Javascript on and off

2008-12-15 Thread Paul Denize
Just to update here is a version of my final routine Hope it helps someone else Paul -- def JavaScript(zone,on=nil,silent=nil) # if on is nil it returns true iff javascript is enabled (not it could also be off or prompt, both false) # if true it sets it to enabled # if false it

[wtr-general] watir .. new_process .. and IE8 (beta 2)

2009-02-19 Thread Paul Denize
Someone unfortunately upgraded one of my PC's. I was pleased to find miost watir scripts still ran. One did not. It was the only one that utilized two IE windows at the same time. The code below demonstrates the issue - it should open two IE windows and print DONE. It does open the browsers

[wtr-general] Problems using :afterText to select fields

2009-02-24 Thread Paul Denize
I had problems with the following html labelUsername/label input type=text name=AJ8765 / ie.text_field(:afterText,'Username').set(XXX) # fails It seems the label tags cause a problem - likewise if they are any other tags span div etc Is this expected behaviour? Paul

[wtr-general] Posting invalid form data with Watir

2009-04-08 Thread Paul Denize
In previous versions of watir I used to send 11 characters to a field that had a maxlimit of 10. This would ensure the server also checked the parameter and did something sensible (truncate or error message). The newer version seems a bit safer and ie.text_field (:index,1).set (01234567890)

[wtr-general] How do I get the page status (200, 404, 500, etc)

2009-04-21 Thread Paul Denize
I must be missing something but I spent some time yesterday trying to get the page status code. But I could not find this anywhere. I want to know if the page I requested failed in some way(404,500), was from the cache(302), or was successfully fetched(200). How do I get the page status? Or

[wtr-general] watir.rb - matches functions

2009-04-21 Thread Paul Denize
In watir.rb there are several class additions to add a matches function that is similar in each type (see below). Wouldn't it be a little more consistent if they all returned the same data types. Regexp.matches returns MatchData or nil The others return true or false class String def

[wtr-general] Watir - some VERY slow functions

2009-05-20 Thread Paul Denize
I finally found a performance issue and it was in the watir library. If a page (and dont get me started about it) has 200 plus radio buttons and your watir script decides to print all the attributes like so radios = ie.radios() for radio in radios puts radio.name puts radio.value end Then

[wtr-general] Re: How do I get the page status (200, 404, 500, etc)

2009-05-20 Thread Paul Denize
Thanks for all the replys. At first I was quite excited then realized they would make additional calls - the cookies, session, conversation elements would all be a nightmare. Not to mention that the load balancer may give valid results sometimes and invalid the next (say if one server is bad).

[wtr-general] Re: watir.rb - matches functions

2009-05-20 Thread Paul Denize
So you can build a function that takes in both an Integer, String, or Regex and then matchs it without having to build a case or switch if (parameter.matches(value)) note parameter could be any of the three types and the correct match function will apply.

[wtr-general] Re: Posting invalid form data with Watir

2009-05-20 Thread Paul Denize
Found a solution ie.text_field(itemtype,itemname).value=text works just fine. Also use the same technique to select options (choice) in a combo where that value may not already exist s = ie.select_list(itemtype,itemname) texts = s.getAllContents if (texts==[])

[wtr-general] Watir (chrome+options) failing with new versions of libs

2017-08-06 Thread Paul Denize
I installed up a new machine with ruby, watir, and selenium-webdriver and the script (that still runs on the previous version) now will not start I produced a minimal script below and the reported error (with version numbers visible in the dump) Is there a workaround to get the new machine

[wtr-general] Suggested code amendment for: Watir::Element#flash

2017-04-29 Thread paul . denize
I'd like to suggest a minor update to Watir::Element#flash I have added three parameters to remove the hard coded values only. I gave them defaults so if not provided the function is backwards compatible. But this allows the external caller to choose what color they want to flash the element

[wtr-general] Re: angular login

2017-04-29 Thread paul . denize
The solution below assumes the input fields should eb treated as input elements and uses the sendkeys, I always add the hash brackest - I just find it easier to as other attributes later. The browser new command has a few usefull switches to maximize the browser by removing user features

[wtr-general] Re: how to resize browser to different sizes or to maximize

2017-05-02 Thread Paul Denize
This should work @browser.driver.window.maximize @browser.driver.window.resize_to(900,900) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general