[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

Re: [wtr-general] how cucumber finds html ids - via DOM or by parsing html code ?

2013-02-08 Thread Ragavan Ambighananthan
apologize my mistake, i know cucumber is more of a regular expression engine. I should have said watir-classic/watir-webdriver. Same question, but for watir : how does it finds the html ids, is it by parsing the html code or looking at the DOM structure ? I read

[wtr-general] Re: watir, watir-webdriver, watir-classic: history and current state?

2013-02-08 Thread Alex Shtayer
but Watir classic is still only for Internet Explorer or something changed? -- -- 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

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

2013-02-08 Thread Alex Shtayer
using regular expressions e.g. browser.link(:id, /.*1234.*/) or xpaths browser.link(:xpath, //a[contains(@id,'1234')])) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com

[wtr-general] Re: how cucumber finds html ids - via DOM or by parsing html code ?

2013-02-08 Thread Alex Shtayer
I know more about the difference between watir (not classic) and watir-webdriver for simple addressing cases like browser.link(:id, 'blah') I do not see any difference in performance or even watir-webdriver works MUCH faster, but for really complex DOMs and complex addressing like

[wtr-general] Re: how to set focus on a popup window and continue work in popup window as a Current window in WATIR

2013-02-08 Thread Alex Shtayer
Did you get some error? It will be informative if you provide some exception or something rather than 'it is not working' Hmm, not sure how such statement can work at all: popup = $browser.attach($browser.link(:url, $browser.link(:url, javascript:doNothing()).click)) .attach method is more

[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

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

2013-02-08 Thread Alex Shtayer
If I understand your question correctly, so both of my examples are given for string case (not for numbers or something) as all DOM values that we get are strings by default or did you mean how you can use variable instead exact number? you can try something like: browser.link(:id,

[wtr-general] Re: watir-classic issue with execute_script and JSON

2013-02-08 Thread captin
Same result. The script errors just continue to pile up. Do you think this is a bug? If so, is it a json2.js or a watir-classic issue? Thanks. On Friday, February 8, 2013 1:39:14 AM UTC-6, Jarmo Pertman wrote: That's sad to hear. What if you run execute_script two times in a row - will

[wtr-general] Re: how to set focus on a popup window and continue work in popup window as a Current window in WATIR

2013-02-08 Thread Dan
If you're just trying to dismiss an alert, it's pretty simple. Here's a working example. b = Watir::Browser.new :firefox b.goto(http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert;) b.frame(:index = 1).button(:value = Show alert box).click # Get the text of the alert if you'd like puts

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

2013-02-08 Thread Dan
it'll work without the wild card characters (.*) as well. A little less to type :). On Friday, February 8, 2013 6:36:16 AM UTC-5, Alex Shtayer wrote: If I understand your question correctly, so both of my examples are given for string case (not for numbers or something) as all DOM values

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

2013-02-08 Thread Alex Shtayer
yes, that's right. just used to that style :) -- -- 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 --- You received this