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
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
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
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
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
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
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
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,
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
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
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
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
12 matches
Mail list logo