Discussion:
[wtr-general] Unable to use API Locators using Watir 6.8.4
Jeff Fagot
2017-11-29 20:31:47 UTC
Permalink
Hello all,

As a new user, I find myself using online posts to make progress and
discoveries on things I ignore.
Based on various posts I found out about the existence of the "API
Locators" such as .div(s) or .span(s)...etc

Even if I am still wondering about their usage after reading about this
discussion :
https://groups.google.com/forum/#!topic/watir-general/G90898izxc4

*QUESTION:* I am still wondering why are the "API Locators" such as
.div(s), .span(s), .element(), .table(s) not working for me knowing that I
am using Watir 6.8.4?


*EXAMPLE*:
* _________ **HTML sample __________________________________*
/
/
/ <table class="month1" cellspacing="0" cellpadding="0" border="0"> /
/_________________________________________________________/

__________ WATIR ________________
/ /
/ fltr_dates = @b.tables(:class, "month1") /
/___________________________________/


*ACTUAL RESULT*:

Whenever I try .table(s), .element() or .div ...etc...I am getting this
kind of error:
* undefined method `tables' for
#<Selenium::WebDriver::Chrome::Driver:0x442d0b**8> (NoMethodError)*

I am only able to use .find_element(s) to locate an element.
__________ WATIR ______________________
/
/
/ fltr_dates = @b.find_elements(:class, "month1") /
/_________________________________________/


*What did I try*:
1) I searched online if anyone had encountered this issue, or to make sure
that those API Locator where still in use on Watir 6.8.4. I found the
discussion posted above that comforted me in the idea that these are still
in use in version 6+ of Watir
2) I have verify and I am getting the same <NoMethodError> error no matter
the browser I use (Chrome, Firefox or IE).

*Hypotheses*: I am wondering if this has anything to do with an
incompatibility of gems mixed together?

Here is my full list of gems:

*** LOCAL GEMS ***

backports (3.9.1)
bigdecimal (1.2.8)
builder (3.2.3)
bundler (1.15.4)
childprocess (0.8.0)
cucumber (3.0.1)
cucumber-core (3.0.0)
cucumber-expressions (4.0.4)
cucumber-tag_expressions (1.0.1)
cucumber-wire (0.0.1)
did_you_mean (1.0.0)
diff-lcs (1.3)
ffi (1.9.18 x86-mingw32)
gherkin (4.1.3)
io-console (0.4.5)
json (1.8.3)
minitest (5.8.5)
multi_json (1.12.2)
multi_test (0.1.2)
net-telnet (0.1.1)
power_assert (0.2.6)
psych (2.1.0)
rainbow (2.2.2)
rake (10.4.2)
rdoc (4.2.1)
rspec (3.6.0)
rspec-core (3.6.0)
rspec-expectations (3.6.0)
rspec-mocks (3.6.0)
rspec-support (3.6.0)
rubyzip (1.2.1)
selenium-webdriver (3.6.0)
test-unit (3.1.5)
watir (6.8.4)

Thanks for your help in this matter.

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

watir-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@googlegroups.com

---
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 watir-general+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Justin Ko
2017-11-29 20:51:48 UTC
Permalink
How did you define `@b`?

Based on the exception and behaviours you are seeing, it sounds like you've
created a Selenium::WebDriver instead of a Watir::Browser. The
initialization should be like:

@b = Watir::Browser.new

- Justin
Post by Jeff Fagot
Hello all,
As a new user, I find myself using online posts to make progress and
discoveries on things I ignore.
Based on various posts I found out about the existence of the "API
Locators" such as .div(s) or .span(s)...etc
Even if I am still wondering about their usage after reading about this
https://groups.google.com/forum/#!topic/watir-general/G90898izxc4
*QUESTION:* I am still wondering why are the "API Locators" such as
.div(s), .span(s), .element(), .table(s) not working for me knowing that I
am using Watir 6.8.4?
* _________ **HTML sample __________________________________*
/
/
/ <table class="month1" cellspacing="0" cellpadding="0" border="0"> /
/_________________________________________________________/
__________ WATIR ________________
/ /
/___________________________________/
Whenever I try .table(s), .element() or .div ...etc...I am getting this
* undefined method `tables' for
#<Selenium::WebDriver::Chrome::Driver:0x442d0b**8> (NoMethodError)*
I am only able to use .find_element(s) to locate an element.
__________ WATIR ______________________
/
/
/_________________________________________/
1) I searched online if anyone had encountered this issue, or to make sure
that those API Locator where still in use on Watir 6.8.4. I found the
discussion posted above that comforted me in the idea that these are still
in use in version 6+ of Watir
2) I have verify and I am getting the same <NoMethodError> error no matter
the browser I use (Chrome, Firefox or IE).
*Hypotheses*: I am wondering if this has anything to do with an
incompatibility of gems mixed together?
*** LOCAL GEMS ***
backports (3.9.1)
bigdecimal (1.2.8)
builder (3.2.3)
bundler (1.15.4)
childprocess (0.8.0)
cucumber (3.0.1)
cucumber-core (3.0.0)
cucumber-expressions (4.0.4)
cucumber-tag_expressions (1.0.1)
cucumber-wire (0.0.1)
did_you_mean (1.0.0)
diff-lcs (1.3)
ffi (1.9.18 x86-mingw32)
gherkin (4.1.3)
io-console (0.4.5)
json (1.8.3)
minitest (5.8.5)
multi_json (1.12.2)
multi_test (0.1.2)
net-telnet (0.1.1)
power_assert (0.2.6)
psych (2.1.0)
rainbow (2.2.2)
rake (10.4.2)
rdoc (4.2.1)
rspec (3.6.0)
rspec-core (3.6.0)
rspec-expectations (3.6.0)
rspec-mocks (3.6.0)
rspec-support (3.6.0)
rubyzip (1.2.1)
selenium-webdriver (3.6.0)
test-unit (3.1.5)
watir (6.8.4)
Thanks for your help in this matter.
Regards,
Jeff Fagot
--
--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.

watir-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@googlegroups.com

---
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 watir-general+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeff Fagot
2017-11-29 21:24:44 UTC
Permalink
Obviously, you are right! I was creating @b as follow: @b =
Selenium::WebDriver.for :
I have no prior history of development or anything, just started with WATIR
1month ago...so my apology for being confused by SELENIUM vs WATIR
specifics.

*UPDATED RESULT*:
I went back to my login screen and find out that after making the change I
should not be using find_element but rather .element (and any API locators
such as .input)

Thank-you for taking the time to help others!

Best regards,
Jeff Fagot
Post by Justin Ko
Based on the exception and behaviours you are seeing, it sounds like
you've created a Selenium::WebDriver instead of a Watir::Browser. The
@b = Watir::Browser.new
- Justin
Post by Jeff Fagot
Hello all,
As a new user, I find myself using online posts to make progress and
discoveries on things I ignore.
Based on various posts I found out about the existence of the "API
Locators" such as .div(s) or .span(s)...etc
Even if I am still wondering about their usage after reading about this
https://groups.google.com/forum/#!topic/watir-general/G90898izxc4
*QUESTION:* I am still wondering why are the "API Locators" such as
.div(s), .span(s), .element(), .table(s) not working for me knowing that I
am using Watir 6.8.4?
* _________ **HTML sample __________________________________*
/
/
/ <table class="month1" cellspacing="0" cellpadding="0" border="0">
/
/_________________________________________________________/
__________ WATIR ________________
/ /
/___________________________________/
Whenever I try .table(s), .element() or .div ...etc...I am getting this
* undefined method `tables' for
#<Selenium::WebDriver::Chrome::Driver:0x442d0b**8> (NoMethodError)*
I am only able to use .find_element(s) to locate an element.
__________ WATIR ______________________
/
/
/_________________________________________/
1) I searched online if anyone had encountered this issue, or to make
sure that those API Locator where still in use on Watir 6.8.4. I found the
discussion posted above that comforted me in the idea that these are still
in use in version 6+ of Watir
2) I have verify and I am getting the same <NoMethodError> error no
matter the browser I use (Chrome, Firefox or IE).
*Hypotheses*: I am wondering if this has anything to do with an
incompatibility of gems mixed together?
*** LOCAL GEMS ***
backports (3.9.1)
bigdecimal (1.2.8)
builder (3.2.3)
bundler (1.15.4)
childprocess (0.8.0)
cucumber (3.0.1)
cucumber-core (3.0.0)
cucumber-expressions (4.0.4)
cucumber-tag_expressions (1.0.1)
cucumber-wire (0.0.1)
did_you_mean (1.0.0)
diff-lcs (1.3)
ffi (1.9.18 x86-mingw32)
gherkin (4.1.3)
io-console (0.4.5)
json (1.8.3)
minitest (5.8.5)
multi_json (1.12.2)
multi_test (0.1.2)
net-telnet (0.1.1)
power_assert (0.2.6)
psych (2.1.0)
rainbow (2.2.2)
rake (10.4.2)
rdoc (4.2.1)
rspec (3.6.0)
rspec-core (3.6.0)
rspec-expectations (3.6.0)
rspec-mocks (3.6.0)
rspec-support (3.6.0)
rubyzip (1.2.1)
selenium-webdriver (3.6.0)
test-unit (3.1.5)
watir (6.8.4)
Thanks for your help in this matter.
Regards,
Jeff Fagot
--
--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.

watir-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@googlegroups.com

---
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 watir-general+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeff Fagot
2017-11-29 21:06:47 UTC
Permalink
I just found this post, which may be a duplicate of mine as I was under an
iframe --> https://groups.google.com/forum/#!topic/watir-general/NEHQIQgOX-o
I will go through it and update if I can confirm or not.

Regards,
Jeff Fagot
Post by Jeff Fagot
Hello all,
As a new user, I find myself using online posts to make progress and
discoveries on things I ignore.
Based on various posts I found out about the existence of the "API
Locators" such as .div(s) or .span(s)...etc
Even if I am still wondering about their usage after reading about this
https://groups.google.com/forum/#!topic/watir-general/G90898izxc4
*QUESTION:* I am still wondering why are the "API Locators" such as
.div(s), .span(s), .element(), .table(s) not working for me knowing that I
am using Watir 6.8.4?
* _________ **HTML sample __________________________________*
/
/
/ <table class="month1" cellspacing="0" cellpadding="0" border="0"> /
/_________________________________________________________/
__________ WATIR ________________
/ /
/___________________________________/
Whenever I try .table(s), .element() or .div ...etc...I am getting this
* undefined method `tables' for
#<Selenium::WebDriver::Chrome::Driver:0x442d0b**8> (NoMethodError)*
I am only able to use .find_element(s) to locate an element.
__________ WATIR ______________________
/
/
/_________________________________________/
1) I searched online if anyone had encountered this issue, or to make sure
that those API Locator where still in use on Watir 6.8.4. I found the
discussion posted above that comforted me in the idea that these are still
in use in version 6+ of Watir
2) I have verify and I am getting the same <NoMethodError> error no matter
the browser I use (Chrome, Firefox or IE).
*Hypotheses*: I am wondering if this has anything to do with an
incompatibility of gems mixed together?
*** LOCAL GEMS ***
backports (3.9.1)
bigdecimal (1.2.8)
builder (3.2.3)
bundler (1.15.4)
childprocess (0.8.0)
cucumber (3.0.1)
cucumber-core (3.0.0)
cucumber-expressions (4.0.4)
cucumber-tag_expressions (1.0.1)
cucumber-wire (0.0.1)
did_you_mean (1.0.0)
diff-lcs (1.3)
ffi (1.9.18 x86-mingw32)
gherkin (4.1.3)
io-console (0.4.5)
json (1.8.3)
minitest (5.8.5)
multi_json (1.12.2)
multi_test (0.1.2)
net-telnet (0.1.1)
power_assert (0.2.6)
psych (2.1.0)
rainbow (2.2.2)
rake (10.4.2)
rdoc (4.2.1)
rspec (3.6.0)
rspec-core (3.6.0)
rspec-expectations (3.6.0)
rspec-mocks (3.6.0)
rspec-support (3.6.0)
rubyzip (1.2.1)
selenium-webdriver (3.6.0)
test-unit (3.1.5)
watir (6.8.4)
Thanks for your help in this matter.
Regards,
Jeff Fagot
--
--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.

watir-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@googlegroups.com

---
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 watir-general+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...