What I think could work is converting test to string, extracting
“?section=int” and concating it with url variable, then navigate to that
page. BUT there must be much better way to achieve that. Is there any
way I can navigate to that subsection of the page, based on section name
(mechanize prefered)? Any help will be greatly appreciated!
You can try both approaches (URL construction and Watir-Webdriver), and
then decide which is the best one for you.
Mechanize will probably accomplish the job more quickly because it is
headless and does not execute JavaScript, but Watir-Webdriver will be
more flexible. The decision is yours, but I would recommend trying both
and deciding based on the results.
I need to navigate to exact subsection and then perform some javascript
clicks etc. (thanks a bunch for mentioning watir-webdriver!). I could
extract final subsection from web page source, but what if section
number changes (and I’m 100% sure section name will stay the same)…
that’s why I want to get there step by step.
So basically you have the same opinion as I do. Extracting section part
from “test” variable with Regex and then concating/assembling it with
partial URL to get desired URL ?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.