I am totally new to Watir World :) & facing a bsic problem:

I am able to click a link by name 'In English' by using the below line of 
code:

@browser.link(:text,'In English').click

However cannot click the same link using *:href* using below code:

@browser.link(:href,'/lis/lisDeskTopAction.changeLanguage.do?method=changeLanguage&LANGUAGE=en&lis.request.page.uid=-234720088').click

*HTML code is :*

<a 
href="/lis/lisDeskTopAction.changeLanguage.do?method=changeLanguage&LANGUAGE=en&lis.request.page.uid=-234720088">


*
*
*Getting error:*

>ruby new.rb
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1230/./watir.rb:2368:in 
`assert_exists': Unable to locate object, using href and 
/lis/lisDeskTopAction.changeLanguage.do?method=changeLanguage&LANGUAGE=en&lis.request.page.uid=-234720088
 
(Watir::Exception::UnknownObjectException)
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1230/./watir.rb:2597:in 
`enabled?'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1230/./watir.rb:2372:in 
`assert_enabled'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1230/./watir.rb:2542:in 
`click!'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1230/./watir.rb:2528:in 
`click'
from new.rb:12
>Exit code: 1

Also I have noticed that the *uid *at the end of the HTML code changes 
every time I visit this page. Can that be the reason ?

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to