[wtr-general] Save Link As with Watir

2013-04-26 Thread Adrian Killens
Hi, does anyone know how I could download a file to a specific folder with Watir and Chrome? I have a link to a pdf file and I'd like to download to a specific folder and change the file name in the process, preferably in the Save As dialog. Cheers Aidy -- -- Before posting, please read

[wtr-general] Partial match on element id

2013-02-08 Thread Adrian Killens
Hi There, Anyone know how to do click something via a partial match on ID? For example if the link was: a href=www.blah.com id=thingy1234thingy How could I click that based on the 1234 and ignore the rest of the id? Cheers Aidy -- -- Before posting, please read http://watir.com/support. In

[wtr-general] Re: Partial match on element id

2013-02-08 Thread Adrian Killens
Thanks for this Alex, how would I format that if the number was stored as a string? e.g. if num1 = '1234' how would I use num1 instead of 1234? On Friday, 8 February 2013 10:45:37 UTC, Alex Shtayer wrote: using regular expressions e.g. browser.link(:id, /.*1234.*/) or xpaths

Re: [wtr-general] Can you create an array from the values in a select list?

2012-11-26 Thread Adrian Killens
Perfect! Thank you :-) -- 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 watir-general+unsubscr...@googlegroups.com

[wtr-general] Can you create an array from the values in a select list?

2012-11-21 Thread Adrian Killens
I can do it with options like this: selectList = b.select_list(:id, 'blah') selectContent = selectList.values.map(:text) b.select(:id, 'blah').select_value(selectContent[1]) But was wondering how I could do the same thing using the value rather than just the option? Cheers Aidy --

Re: [wtr-general] Can you create an array from the values in a select list?

2012-11-21 Thread Adrian Killens
. On Thursday, 22 November 2012 00:37:33 UTC, Oscar.Rieken wrote: what does the html of the select list look like On Wed, Nov 21, 2012 at 5:14 PM, Adrian Killens ack...@googlemail.comjavascript: wrote: I can do it with options like this: selectList = b.select_list(:id, 'blah

[wtr-general] Clicking links that use non-english characters

2012-11-09 Thread Adrian Killens
Hi There, Does anyone know how I can click things in non-english languages that have non-english characters identifying them? E.g. browser.link(:id, 'Tovább').click I get the following trying to click these links: invalid multibyte char (US-ASCII) (SyntaxError) invalid multibyte char

Re: [wtr-general] Clicking links that use non-english characters

2012-11-09 Thread Adrian Killens
,/Tovabb/).click Regards, Joe On Fri, Nov 9, 2012 at 7:49 AM, Adrian Killens ack...@googlemail.comjavascript: wrote: Hi There, Does anyone know how I can click things in non-english languages that have non-english characters identifying them? E.g. browser.link(:id, 'Tovább

Re: [wtr-general] Clicking links that use non-english characters

2012-11-09 Thread Adrian Killens
. Is this normal? Cheers Aidy On Friday, 9 November 2012 15:23:59 UTC, Adrian Killens wrote: That didn't work, in this instance I need to grab via the non-english tags as I'm doing some testing around translations. On Friday, 9 November 2012 14:17:19 UTC, Joe Fl wrote: Hi Aidy

[wtr-general] Random numbers

2012-11-02 Thread Adrian Killens
How would you write something to generate a random number that aren't sequential. E.g. generate a random number picked from these four: 10, 9, 55, 3 Cheers Aidy -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com

[wtr-general] Checking if a certain value exists in a dropdown

2012-10-22 Thread Adrian Killens
select name=title id=titleoption value=-1/option option value=26Mr /option option value=27Mrs /option option value=28Miss /option /select How would I write a statement to do something if value 26 exists? I tried this and it didn't work: if b.select(:id, title).include?('26') do something

[wtr-general] Re: Checking if a certain value exists in a dropdown

2012-10-22 Thread Adrian Killens
Legend!! On Monday, 22 October 2012 13:06:17 UTC+1, Adrian Killens wrote: select name=title id=titleoption value=-1/option option value=26Mr /option option value=27Mrs /option option value=28Miss /option /select How would I write a statement to do something if value 26 exists? I tried

[wtr-general] Unable to click link - Element must be displayed to click

2012-10-17 Thread Adrian Killens
Bit of a random one but I cannot click a link on a page within my test suite. I can click it fine using irb and running the test line by line and if I put in an if statement to check if the link exists? in the suite then it also appears to be there. But for some reason when I try to click it

[wtr-general] Re: Unable to click link - Element must be displayed to click

2012-10-17 Thread Adrian Killens
be an issue is that I'm clicking a button before hand that set in a div that's hosted on a different domain. I'm wondering if this is confusing it? On Wednesday, 17 October 2012 14:40:07 UTC+1, Adrian Killens wrote: Bit of a random one but I cannot click a link on a page within my test suite

[wtr-general] Re: How do you write an IF statement around a class name?

2012-10-16 Thread Adrian Killens
Cheers for that :-) On Friday, 12 October 2012 18:36:42 UTC+1, Adrian Killens wrote: div id=blah class=item45 Using the above as an example, how would I write an if statement that was something along the lines of if item with id blah is class 'item45' then do something I can do

[wtr-general] How do you write an IF statement around a class name?

2012-10-12 Thread Adrian Killens
div id=blah class=item45 Using the above as an example, how would I write an if statement that was something along the lines of if item with id blah is class 'item45' then do something I can do this with other attributes such as Size but seem to be unable to do this with class For example,

[wtr-general] Re: How do you write an IF statement around a class name?

2012-10-12 Thread Adrian Killens
Actually managed to work this one out on my own :-) you use class_name e.g. if b.div(:id, hello).class_name == blah puts blah else puts not blah end On Friday, 12 October 2012 18:36:42 UTC+1, Adrian Killens wrote: div id=blah class=item45 Using the above as an example, how would I write

[wtr-general] Can you use id and index?

2012-10-11 Thread Adrian Killens
Is it possible to use both and index and an id to get button? e.g. if I had a 10 buttons all with the id AddToBasket could I use the id and the index to just click the first of the 10? Cheers Aidy -- Before posting, please read http://watir.com/support. In short: search before you ask, be

Re: [wtr-general] Can you use id and index?

2012-10-11 Thread Adrian Killens
Thank you once again! All sorted, I'm now using browser.button(:id = AddToBasket, :index = 0) Aidy :-) On Thursday, 11 October 2012 10:10:18 UTC+1, Željko Filipin wrote: On Thu, Oct 11, 2012 at 10:48 AM, Adrian Killens ack...@googlemail.comjavascript: wrote: Is it possible to use both

Re: [wtr-general] How do I get the value of a span?

2012-10-10 Thread Adrian Killens
Thank you once again! On Friday, 5 October 2012 17:32:19 UTC+1, Željko Filipin wrote: On Fri, Oct 5, 2012 at 6:10 PM, Adrian Killens ack...@googlemail.comjavascript: wrote: h1 class=ThankYouForOrderingThank you for ordering: span class=ReferenceNumberOB6786/span/h1 How would I get

[wtr-general] iFrame with changing name

2012-10-10 Thread Adrian Killens
How would I use a frame if the name keeps changing? E.g. like the one below, would I be able to use some kind of wildcard to get the word default regardless of what the frame name/id ends with? In this case it's just the number which changes. iframe name=default5663_provider id=default5663

[wtr-general] Check to see if a dropdown list contains a value

2012-10-05 Thread Adrian Killens
How would I check to see if a dropdown list contained a specific value? So the test would be something along the lines of: if *select box contains the value MR* * b.select(:id, title).select('Mr') * -- Before posting, please read http://watir.com/support. In short: search before you ask, be

[wtr-general] Re: Check to see if a dropdown list contains a value

2012-10-05 Thread Adrian Killens
Spot on! Thanks. Love this group :-) On Friday, 5 October 2012 09:42:07 UTC+1, Adrian Killens wrote: How would I check to see if a dropdown list contained a specific value? So the test would be something along the lines of: if *select box contains the value MR* * b.select(:id, title

[wtr-general] How do I get the value of a span?

2012-10-05 Thread Adrian Killens
HTML h1 class=ThankYouForOrderingThank you for ordering: span class= ReferenceNumberOB6786/span/h1 How would I get the OB6786 part of that into a string? So I could output it with my test results? Cheers Aidy -- Before posting, please read http://watir.com/support. In short: search before

[wtr-general] How do i check that something doesn't exist?

2012-10-04 Thread Adrian Killens
How do I check that something does NOT exist on a page. E.g. the opposite to the statement below: if b.radio(:id, 'CheckBox').exists? Thanks in advance :-) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com

Re: [wtr-general] How do i check that something doesn't exist?

2012-10-04 Thread Adrian Killens
Thank you :-) On Thursday, 4 October 2012 10:30:35 UTC+1, Joe Fl wrote: Hi, if !b.radio(:id, 'CheckBox').exists? Joe On Oct 4, 2012 4:05 AM, Adrian Killens ack...@googlemail.comjavascript: wrote: How do I check that something does NOT exist on a page. E.g. the opposite

[wtr-general] dbi - select specific value from MSSQL

2012-09-27 Thread Adrian Killens
Hi There, Does anyone know how to select a specific value from a database? I'm running a query that returns a few rows and columns but if I want to output a specific value, e.g. row1, col2. How would I do that? Cheers Aidy -- Before posting, please read http://watir.com/support. In short:

Re: [wtr-general] dbi - select specific value from MSSQL

2012-09-27 Thread Adrian Killens
I know, I've accessed the db and managed to get back data but I can't select a specific value from the data I get back. On Thursday, 27 September 2012 09:19:37 UTC+1, Željko Filipin wrote: On Thu, Sep 27, 2012 at 9:37 AM, Adrian Killens ack...@googlemail.comjavascript: wrote: Does

[wtr-general] Re: dbi - select specific value from MSSQL

2012-09-27 Thread Adrian Killens
the first row. How would I bring back a more specific value. e.g. first column, first row? On Thursday, 27 September 2012 08:37:02 UTC+1, Adrian Killens wrote: Hi There, Does anyone know how to select a specific value from a database? I'm running a query that returns a few rows and columns but if I

[wtr-general] Re: dbi - select specific value from MSSQL

2012-09-27 Thread Adrian Killens
Excellent!! Once again, thank you very much :-) On Thursday, 27 September 2012 08:37:02 UTC+1, Adrian Killens wrote: Hi There, Does anyone know how to select a specific value from a database? I'm running a query that returns a few rows and columns but if I want to output a specific value

Re: [wtr-general] Selecting Dropdown via Value

2012-09-26 Thread Adrian Killens
Thank you Željko :-) That was driving me nuts! On Tuesday, 25 September 2012 16:04:15 UTC+1, Željko Filipin wrote: On Tue, Sep 25, 2012 at 1:30 PM, Adrian Killens ack...@googlemail.comjavascript: wrote: select name=hello size=1 option value=CX Large/option How would I select from

[wtr-general] Selecting Dropdown via Value

2012-09-25 Thread Adrian Killens
Hi There, Does anyone know how I can select a dropdown via the value rather than the name e.g. select name=hello size=1 option value=AMedium/option option value=BLarge/option option value=CX Large/option How would I select from this dropdown using the value C? So that if I'm testing in