Re: [wtr-general] Watir and Edge Chromium - Getting an error

2020-09-08 Thread Titus Fortner
Yes, things just got tricky with a dev dependency I wanted to fix first
before releasing. I'll bump this up in priority. Thanks.

On Tue, Sep 8, 2020 at 10:25 AM Champ  wrote:

> Is there a plan to release new version of watir that allows using Selenium
> 4alpha soon?
>
> On Wednesday, September 2, 2020 at 2:52:56 PM UTC-4 titusf...@gmail.com
> wrote:
>
>> Oh, except I need to release a version of Watir that allows using
>> Selenium 4alpha
>>
>> On Wednesday, September 2, 2020 at 11:50:47 AM UTC-7 Titus Fortner wrote:
>>
>>> Ah, ok, this is definitely a bug. Selenium 3.x is not properly handling
>>> the new chromium edge.
>>>
>>> You can file an issue with this information on Selenium github tracker.
>>> https://github.com/SeleniumHQ/selenium/issues/new?template=bug.md
>>>
>>> The best way forward right now is to update to Selenium 4 alpha.
>>> 4.0.0.alpha6 requires you to use `:edge_chrome` instead of just `:edge`;
>>> this will change whenever we release 4.0.0.alpha7
>>>
>>> On Wednesday, September 2, 2020 at 7:37:02 AM UTC-7 Champ wrote:
>>>
>>>> Here is the stacktrace with selenium logging ON.
>>>>
>>>> >ruby google_edge.rb
>>>> 2020-09-02 10:32:12 INFO Selenium -> POST session
>>>> 2020-09-02 10:32:12 INFO Selenium>>> http://127.0.0.1:17556/session
>>>> |
>>>> {"desiredCapabilities":{"browserName":"MicrosoftEdge","version":"","platform":"WINDOWS","javascriptEnabled":false,"cssSelectorsEnabled":false,"takesScreenshot":false,"nativeEvents":false,"rotatable":false,"edgeOptions":{"args":["--start-maximized"],"w3c":true}},"capabilities":{"firstMatch":[{"browserName":"MicrosoftEdge"}]}}
>>>> 2020-09-02 10:32:15 INFO Selenium <-
>>>> {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"msedge","browserVersion":"85.0.564.44","ms:edgeOptions":{"debuggerAddress":"localhost:55594"},"msedge":{"msedgedriverVersion":"85.0.564.44
>>>> (3b106b45f8e7cd4c3e2aac5a6ba411645c16df60)","userDataDir":"C:\\Users\\abcd\\AppData\\Local\\Temp\\scoped_dir7340_637088237"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":30,"script":3},"unhandledPromptBehavior":"dismiss
>>>> and
>>>> notify","webauthn:virtualAuthenticators":true},"sessionId":"42611dc953d38632f3646f4e14ccc088"}}
>>>> 2020-09-02 10:32:15 INFO Selenium Detected W3C dialect.
>>>> 2020-09-02 10:32:15 INFO Selenium Forcing W3C dialect.
>>>> 2020-09-02 10:32:15 INFO Selenium -> POST
>>>> session/42611dc953d38632f3646f4e14ccc088/url
>>>> 2020-09-02 10:32:15 INFO Selenium>>>
>>>> http://127.0.0.1:17556/session/42611dc953d38632f3646f4e14ccc088/url |
>>>> {"url":"https://google.com"}
>>>> 2020-09-02 10:32:17 INFO Selenium <- {"value":null}
>>>> 2020-09-02 10:32:17 INFO Selenium -> POST
>>>> session/42611dc953d38632f3646f4e14ccc088/element
>>>> 2020-09-02 10:32:17 INFO Selenium>>>
>>>> http://127.0.0.1:17556/session/42611dc953d38632f3646f4e14ccc088/element
>>>> | {"using":"xpath","value":".//*[local-name()='input'][not(@type) or
>>>> (translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà ÎÃ
>>>> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzÃ
>>>> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ')!=translate('file','ABCDEFGHIJKLMNOPQRSTUVWXYZÀÃ
>>>> ÂÃÄÅÆÇÈÉÊËÌà Îà à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽÅ
>>>> Å’','abcdefghijklmnopqrstuvwxyzÃ
>>>> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ') and
>>>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà ÎÃ
>>>> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzÃ
>>>> áâãäåæçèéêÃ

Re: [wtr-general] Watir and Edge Chromium - Getting an error

2020-09-02 Thread Titus Fortner
Oh, except I need to release a version of Watir that allows using Selenium 
4alpha

On Wednesday, September 2, 2020 at 11:50:47 AM UTC-7 Titus Fortner wrote:

> Ah, ok, this is definitely a bug. Selenium 3.x is not properly handling 
> the new chromium edge.
>
> You can file an issue with this information on Selenium github tracker.
> https://github.com/SeleniumHQ/selenium/issues/new?template=bug.md
>
> The best way forward right now is to update to Selenium 4 alpha.
> 4.0.0.alpha6 requires you to use `:edge_chrome` instead of just `:edge`; 
> this will change whenever we release 4.0.0.alpha7
>
> On Wednesday, September 2, 2020 at 7:37:02 AM UTC-7 Champ wrote:
>
>> Here is the stacktrace with selenium logging ON.
>>
>> >ruby google_edge.rb
>> 2020-09-02 10:32:12 INFO Selenium -> POST session
>> 2020-09-02 10:32:12 INFO Selenium>>> http://127.0.0.1:17556/session 
>> | 
>> {"desiredCapabilities":{"browserName":"MicrosoftEdge","version":"","platform":"WINDOWS","javascriptEnabled":false,"cssSelectorsEnabled":false,"takesScreenshot":false,"nativeEvents":false,"rotatable":false,"edgeOptions":{"args":["--start-maximized"],"w3c":true}},"capabilities":{"firstMatch":[{"browserName":"MicrosoftEdge"}]}}
>> 2020-09-02 10:32:15 INFO Selenium <- 
>> {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"msedge","browserVersion":"85.0.564.44","ms:edgeOptions":{"debuggerAddress":"localhost:55594"},"msedge":{"msedgedriverVersion":"85.0.564.44
>>  
>> (3b106b45f8e7cd4c3e2aac5a6ba411645c16df60)","userDataDir":"C:\\Users\\abcd\\AppData\\Local\\Temp\\scoped_dir7340_637088237"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":30,"script":3},"unhandledPromptBehavior":"dismiss
>>  
>> and 
>> notify","webauthn:virtualAuthenticators":true},"sessionId":"42611dc953d38632f3646f4e14ccc088"}}
>> 2020-09-02 10:32:15 INFO Selenium Detected W3C dialect.
>> 2020-09-02 10:32:15 INFO Selenium Forcing W3C dialect.
>> 2020-09-02 10:32:15 INFO Selenium -> POST 
>> session/42611dc953d38632f3646f4e14ccc088/url
>> 2020-09-02 10:32:15 INFO Selenium>>> 
>> http://127.0.0.1:17556/session/42611dc953d38632f3646f4e14ccc088/url | 
>> {"url":"https://google.com"}
>> 2020-09-02 10:32:17 INFO Selenium <- {"value":null}
>> 2020-09-02 10:32:17 INFO Selenium -> POST 
>> session/42611dc953d38632f3646f4e14ccc088/element
>> 2020-09-02 10:32:17 INFO Selenium>>> 
>> http://127.0.0.1:17556/session/42611dc953d38632f3646f4e14ccc088/element 
>> | {"using":"xpath","value":".//*[local-name()='input'][not(@type) or 
>> (translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà Îà 
>> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzà 
>> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ')!=translate('file','ABCDEFGHIJKLMNOPQRSTUVWXYZÀÃ
>>  
>> ÂÃÄÅÆÇÈÉÊËÌà Îà à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠ
>> Œ','abcdefghijklmnopqrstuvwxyzà 
>> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ') and 
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà Îà 
>> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzà 
>> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ')!=translate('radio','ABCDEFGHIJKLMNOPQRSTUVWXYZÀÃ
>>  
>> ÂÃÄÅÆÇÈÉÊËÌà Îà à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠ
>> Œ','abcdefghijklmnopqrstuvwxyzà 
>> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ') and 
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà Îà 
>> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzà 
>> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ')!=translate('checkbox','ABCDEFGHIJKLMNOPQRSTUVWXYZÀÃ
>>  
>> ÂÃÄÅÆÇÈÉÊËÌÃ

Re: [wtr-general] Watir and Edge Chromium - Getting an error

2020-09-02 Thread Titus Fortner
Ah, ok, this is definitely a bug. Selenium 3.x is not properly handling the 
new chromium edge.

You can file an issue with this information on Selenium github tracker.
https://github.com/SeleniumHQ/selenium/issues/new?template=bug.md

The best way forward right now is to update to Selenium 4 alpha.
4.0.0.alpha6 requires you to use `:edge_chrome` instead of just `:edge`; 
this will change whenever we release 4.0.0.alpha7

On Wednesday, September 2, 2020 at 7:37:02 AM UTC-7 Champ wrote:

> Here is the stacktrace with selenium logging ON.
>
> >ruby google_edge.rb
> 2020-09-02 10:32:12 INFO Selenium -> POST session
> 2020-09-02 10:32:12 INFO Selenium>>> http://127.0.0.1:17556/session | 
> {"desiredCapabilities":{"browserName":"MicrosoftEdge","version":"","platform":"WINDOWS","javascriptEnabled":false,"cssSelectorsEnabled":false,"takesScreenshot":false,"nativeEvents":false,"rotatable":false,"edgeOptions":{"args":["--start-maximized"],"w3c":true}},"capabilities":{"firstMatch":[{"browserName":"MicrosoftEdge"}]}}
> 2020-09-02 10:32:15 INFO Selenium <- 
> {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"msedge","browserVersion":"85.0.564.44","ms:edgeOptions":{"debuggerAddress":"localhost:55594"},"msedge":{"msedgedriverVersion":"85.0.564.44
>  
> (3b106b45f8e7cd4c3e2aac5a6ba411645c16df60)","userDataDir":"C:\\Users\\abcd\\AppData\\Local\\Temp\\scoped_dir7340_637088237"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":30,"script":3},"unhandledPromptBehavior":"dismiss
>  
> and 
> notify","webauthn:virtualAuthenticators":true},"sessionId":"42611dc953d38632f3646f4e14ccc088"}}
> 2020-09-02 10:32:15 INFO Selenium Detected W3C dialect.
> 2020-09-02 10:32:15 INFO Selenium Forcing W3C dialect.
> 2020-09-02 10:32:15 INFO Selenium -> POST 
> session/42611dc953d38632f3646f4e14ccc088/url
> 2020-09-02 10:32:15 INFO Selenium>>> 
> http://127.0.0.1:17556/session/42611dc953d38632f3646f4e14ccc088/url | 
> {"url":"https://google.com"}
> 2020-09-02 10:32:17 INFO Selenium <- {"value":null}
> 2020-09-02 10:32:17 INFO Selenium -> POST 
> session/42611dc953d38632f3646f4e14ccc088/element
> 2020-09-02 10:32:17 INFO Selenium>>> 
> http://127.0.0.1:17556/session/42611dc953d38632f3646f4e14ccc088/element | 
> {"using":"xpath","value":".//*[local-name()='input'][not(@type) or 
> (translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà Îà 
> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ')!=translate('file','ABCDEFGHIJKLMNOPQRSTUVWXYZÀÃ
>  
> ÂÃÄÅÆÇÈÉÊËÌà Îà à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠ
> Œ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ') and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà Îà 
> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ')!=translate('radio','ABCDEFGHIJKLMNOPQRSTUVWXYZÀÃ
>  
> ÂÃÄÅÆÇÈÉÊËÌà Îà à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠ
> Œ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ') and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà Îà 
> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ')!=translate('checkbox','ABCDEFGHIJKLMNOPQRSTUVWXYZÀÃ
>  
> ÂÃÄÅÆÇÈÉÊËÌà Îà à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠ
> Œ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ') and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà Îà 
> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ')!=translate('submit','ABCDEFGHIJKLMNOPQRSTUVWXYZÀÃ
>  
> ÂÃÄÅÆÇÈÉÊËÌà Îà à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠ
> Œ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ') and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà Îà 
> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ')!=translate('reset','ABCDEFGHIJKLMNOPQRSTUVWXYZÀÃ
>  
> ÂÃÄÅÆÇÈÉÊËÌà Îà à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠ
> Œ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ') and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZÀà ÂÃÄÅÆÇÈÉÊËÌà Îà 
> à ÑÒÓÔÕÖØÙÚÛÜà ÞŸŽŠŒ','abcdefghijklmnopqrstuvwxyzà 
> áâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ')!=translate('image','ABCDEFGHIJKLMNOPQRSTUVWXYZÀÃ
>  
> ÂÃÄÅÆÇ

Re: [wtr-general] Watir and Edge Chromium - Getting an error

2020-09-02 Thread Titus Fortner
No, I think Google is just being more backward compatible right now, which
isn't a bug for microsoft, but for the software calling a bad endpoint. So
it could be a Watir Bug.
Can you turn on the Selenium logging and show me the full log/stacktrace
for the offending section?
`Watir.logger.selenium = :info`




On Wed, Sep 2, 2020 at 7:18 AM Champ  wrote:

> Thank you for the response. This works fine on chrome browser with w3c set
> to true.
>
> However, on Edge chromium if I set W3C to true, I get this error. It looks
> like a bug in Edge driver?
>
> *Backtrace:: unknown command: Cannot call non W3C standard command while
> in W3C mode (Selenium::WebDriver::Error::UnknownCommandError)*
>
> from Ordinal0 [0x7FF66AAB8F72+4099954]
> from Ordinal0 [0x7FF66A98E439+2876473]
> from Ordinal0 [0x7FF66A800227+1245735]
> from Ordinal0 [0x7FF66A757300+553728]
> from Ordinal0 [0x7FF66A75824E+557646]
> from Ordinal0 [0x7FF66A9AAA66+2992742]
> from GetHandleVerifier [0x7FF66ABFB5D3+1202179]
> from GetHandleVerifier [0x7FF66AC10371+1287585]
> from GetHandleVerifier [0x7FF66ABFC227+1205335]
> from Ordinal0 [0x7FF66A99F3A1+2945953]
> from Ordinal0 [0x7FF66A9AC8A9+3000489]
> from Ordinal0 [0x7FF66A9C14D8+3085528]
> from BaseThreadInitThunk [0x7FFD1ED07BD4+20]
> from RtlUserThreadStart [0x7FFD1F36CE51+33]
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/response.rb:72:in
> `assert_ok'
>
> On Wednesday, September 2, 2020 at 9:40:20 AM UTC-4 titusf...@gmail.com
> wrote:
>
>> Is there a reason you are setting w3c to false? (if you are testing on
>> Chromium > 75 you should be using w3c)
>>
>> Try setting w3c to true, and if it doesn't work, try running it with
>> Chrome. If things are still failing, we'll have to figure out the right bug
>> report for the chromedriver/chromium teams.
>>
>> On Tue, Sep 1, 2020 at 10:46 AM Champ  wrote:
>>
>>> I am using the below code to start using Watir-webdriver with Edge
>>> Chromium browser. I have the right versions and drivers. It launches the
>>> browser and opens the url.
>>> But I get the following error when I try to interact with the
>>> browser(set, .present? etc.)
>>>
>>> Any pointers/fixes are really appreciated.
>>>
>>>
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/response.rb:72:in*
>>> `assert_ok': javascript error: a.getAttributeNode is not a function
>>> (Selenium::WebDriver::Error::JavascriptError)*
>>>
>>> Here is the code:
>>>
>>> *require* 'watir'
>>> *require* 'selenium-webdriver'
>>>
>>> Selenium::WebDriver::Edge::Service.driver_path *=*
>>>  "c:/drivers/msedgedriver.exe"
>>>
>>> $browser *=* Watir::Browser.*new*
>>>  :edge, "edgeOptions" => {"args" => [ "--start-maximized" ], "w3c" => false}
>>>
>>> $browser.goto("https://google.com";)
>>>
>>> $browser.text_field(:name=>"q").set("watir")
>>>
>>> ===
>>>
>>> Full stacktrace below:
>>>
>>> >ruby google_edge.rb
>>>
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/response.rb:72:in
>>> `assert_ok': javascript error: a.getAttributeNode is not a function
>>> (Selenium::WebDriver::Error::JavascriptError)
>>>
>>>   (Session info: MicrosoftEdge=85.0.564.44)
>>>
>>>   (Driver info: msedgedriver=85.0.564.44
>>> (3b106b45f8e7cd4c3e2aac5a6ba411645c16df60),platform=Windows NT 10.0.18363
>>> x86_64)
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/response.rb:34:in
>>> `initialize'
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/common.rb:88:in
>>> `new'
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/common.rb:88:in
>>> `create_response'
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/default.rb:114:in
>>> `request'
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/common.rb:64:in
>>> `call'
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/bridge.rb:167:in
>>> `execute'
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:567:in
>>> `execute'
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:305:in
>>> `execute_script'
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/atoms.rb:32:in
>>> `execute_atom'
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:476:in
>>> `element_attribute'
>>>
>>> from
>>> C:/Ruby27-x64/lib/ruby/gems/2.7.0/g

Re: [wtr-general] Watir and Edge Chromium - Getting an error

2020-09-02 Thread Titus Fortner
Is there a reason you are setting w3c to false? (if you are testing on
Chromium > 75 you should be using w3c)

Try setting w3c to true, and if it doesn't work, try running it with
Chrome. If things are still failing, we'll have to figure out the right bug
report for the chromedriver/chromium teams.

On Tue, Sep 1, 2020 at 10:46 AM Champ  wrote:

> I am using the below code to start using Watir-webdriver with Edge
> Chromium browser. I have the right versions and drivers. It launches the
> browser and opens the url.
> But I get the following error when I try to interact with the browser(set,
> .present? etc.)
>
> Any pointers/fixes are really appreciated.
>
>
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/response.rb:72:in*
> `assert_ok': javascript error: a.getAttributeNode is not a function
> (Selenium::WebDriver::Error::JavascriptError)*
>
> Here is the code:
>
> *require* 'watir'
> *require* 'selenium-webdriver'
>
> Selenium::WebDriver::Edge::Service.driver_path *=*
>  "c:/drivers/msedgedriver.exe"
>
> $browser *=* Watir::Browser.*new*
>  :edge, "edgeOptions" => {"args" => [ "--start-maximized" ], "w3c" => false}
>
> $browser.goto("https://google.com";)
>
> $browser.text_field(:name=>"q").set("watir")
>
> ===
>
> Full stacktrace below:
>
> >ruby google_edge.rb
>
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/response.rb:72:in
> `assert_ok': javascript error: a.getAttributeNode is not a function
> (Selenium::WebDriver::Error::JavascriptError)
>
>   (Session info: MicrosoftEdge=85.0.564.44)
>
>   (Driver info: msedgedriver=85.0.564.44
> (3b106b45f8e7cd4c3e2aac5a6ba411645c16df60),platform=Windows NT 10.0.18363
> x86_64)
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/response.rb:34:in
> `initialize'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/common.rb:88:in
> `new'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/common.rb:88:in
> `create_response'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/default.rb:114:in
> `request'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/common.rb:64:in
> `call'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/bridge.rb:167:in
> `execute'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:567:in
> `execute'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:305:in
> `execute_script'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/atoms.rb:32:in
> `execute_atom'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:476:in
> `element_attribute'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/element.rb:116:in
> `attribute'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/watir-6.17.0/lib/watir/elements/element.rb:315:in
> `block in attribute_value'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/watir-6.17.0/lib/watir/elements/element.rb:804:in
> `element_call'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/watir-6.17.0/lib/watir/elements/element.rb:315:in
> `attribute_value'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/watir-6.17.0/lib/watir/attribute_helper.rb:74:in
> `block in define_boolean_attribute'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/watir-6.17.0/lib/watir/elements/element.rb:719:in
> `wait_for_writable'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/watir-6.17.0/lib/watir/elements/element.rb:838:in
> `check_condition'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/watir-6.17.0/lib/watir/elements/element.rb:802:in
> `element_call'
>
> from
> C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/watir-6.17.0/lib/watir/user_editable.rb:10:in
> `set'
>
> from google_edge.rb:8:in `'
>
> >Exit code: 1
>
>
>
> --
> --
> Before posting, please read
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>
> 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 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/watir-general/83cdcdf1-83cb-4190-bd2c-2a4

Re: [wtr-general] Re: Elements - Multiple locators for same element

2019-12-04 Thread Titus Fortner
Right, I'm not a big fan of that pattern, as it makes executing
deterministic tests more challenging. If you want to use it to apply to
multiple views like mobile/desktop, you're going to introduce race
conditions. If you want to use it to minimize brittleness you run the risk
of testing the wrong thing.

Requiring explicitness in this case is a feature not a bug.

On Wed, Dec 4, 2019, 6:32 AM Aionitoaie Andrei 
wrote:

> Thanks,
>
> I was looking something more like OR evaluation.
>
> luni, 2 decembrie 2019, 22:38:45 UTC+2, Titus Fortner a scris:
>>
>> Watir allows you to locate elements with multiple locators with an
>> implied "AND" it does not support multiple locators with an "OR" evaluation.
>>
>> What is supported is described here: http://watir.com/guides/locating/
>>
>>
>> On Monday, December 2, 2019 at 1:17:16 PM UTC-6, Aionitoaie Andrei wrote:
>>>
>>> Hi,
>>>
>>> Does Watir has something like identifying the same element using
>>> multiple locators? Something like Appium has: @AndroidFindBy and @IOSFindBy?
>>>
>>> Or maybe some suggestions about how to achieve this?
>>>
>>> Thanks,
>>> Andrei
>>>
>> --
> --
> Before posting, please read
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>
> 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 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/watir-general/2205db86-bb17-4fb0-8f44-4c7137f65254%40googlegroups.com
> <https://groups.google.com/d/msgid/watir-general/2205db86-bb17-4fb0-8f44-4c7137f65254%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/CAKSYPug8QbzyfxYthg54cSx8VumzW6nQz1TdEB07x69WJtvPAA%40mail.gmail.com.


[wtr-general] Re: Elements - Multiple locators for same element

2019-12-02 Thread Titus Fortner
Watir allows you to locate elements with multiple locators with an implied 
"AND" it does not support multiple locators with an "OR" evaluation.

What is supported is described here: http://watir.com/guides/locating/


On Monday, December 2, 2019 at 1:17:16 PM UTC-6, Aionitoaie Andrei wrote:
>
> Hi,
>
> Does Watir has something like identifying the same element using multiple 
> locators? Something like Appium has: @AndroidFindBy and @IOSFindBy?
>
> Or maybe some suggestions about how to achieve this?
>
> Thanks,
> Andrei
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/8fbb7a27-9c51-4a5c-a72b-620379abbd25%40googlegroups.com.


Re: [wtr-general] Re: Click succeeds but action as the result of that click is not triggered

2019-08-11 Thread Titus Fortner
If a sleep fixes it, it's a race condition. The rest doesn't matter.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/4de0396d-ded2-4ecb-94bc-a58f9d8fae52%40googlegroups.com.


Re: [wtr-general] Re: Click succeeds but action as the result of that click is not triggered

2019-08-10 Thread Titus Fortner
If a sleep fixes it, then it isn't the test library code or the driver, it has 
to do with when the app you are testing assigns the events to the elements. Is 
it angular or react? Essentially the test code is telling the driver to click 
before the app is ready, even though the element is displayed and enabled, etc. 
Unfortunately there isn't an easy fix for this. I have in the past implemented 
a click_until method that would check for the click doing what I wanted it to 
do and retrying if it didn't.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/fd8d7ecd-77d1-4fab-92aa-f6bc57b16858%40googlegroups.com.


Re: [wtr-general] Re: Click succeeds but action as the result of that click is not triggered

2019-08-03 Thread Titus Fortner
This code works just fine for me. I'm on a Mac, and I can't easily check it 
works on Windows, but everything looks good to me.
Is it perhaps a timing issue on your machine? If you temporarily put a 
sleep statement there will it work?


On Friday, August 2, 2019 at 10:34:58 PM UTC-7, rajagopalan madasami wrote:
>
> Click is issued but action as a result of that click is not triggered.
>
> Okay, execute this code, you would see program succeeds but application 
> doesn't get logged in.
>
> require 'watir'
>> b=Watir::Browser.new :firefox
>> b.goto 'https://uat.allianz-go.com'
>> b.text_field(name: 'username').set 'JyoUser'
>> b.text_field(name: 'password').set 'Test@123'
>> b.button(id: 'producer').click
>>
>
>
>
> On Friday, 2 August 2019 20:40:54 UTC+5:30, Titus Fortner wrote:
>>
>> A single click not happening is not what you described in the ticket. Can 
>> you provide the code you used to generate this log and how it is different 
>> from what you expect?
>>
>>
>> On Thu, Aug 1, 2019, 1:58 AM rajagopalan madasami  
>> wrote:
>>
>>> I have created a gist here, You can see click is issued but not 
>>> triggered anything. But I am not sure whether you can know whether page has 
>>> moved to the next page or not but I can see while I am running it.
>>>
>>> https://gist.github.com/Rajagopalan-M/1e5b68be57a8fa3599c56b9c0364dd6c
>>>
>>> On Thursday, 1 August 2019 12:54:56 UTC+5:30, Titus Fortner wrote:
>>>>
>>>> I literally and explicitly said the exact opposite of what you did. 
>>>>
>>>> The logs you provided on Github showed the driver only received one 
>>>> request to click an element. If you expected it to have received more, 
>>>> then 
>>>> you need to figure out why the code did not send more, hence my suggestion 
>>>> to obtain more logging information. Or even better use a debugger to walk 
>>>> through the code to figure out where the disconnect is.
>>>>
>>>>
>>>>
>>>> On Wednesday, July 31, 2019 at 10:11:30 PM UTC-7, rajagopalan madasami 
>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>>> On Friday, 19 July 2019 22:39:27 UTC+5:30, Titus Fortner wrote:
>>>>>>
>>>>>> The trace you provided only shows a single click, so it isn't a 
>>>>>> geckodriver issue.
>>>>>>
>>>>>> Do Watir.logger.level = :debug & Selenium::WebDriver.logger.level = 
>>>>>> :debug
>>>>>> link to a gist with the output. Something appears to be preventing 
>>>>>> the click command from happening.
>>>>>>
>>>>>> >> Something appears to be preventing the click command from 
>>>>>> happening.<<
>>>>>>
>>>>>
>>>>> Then it should be the problem with geckodriver,eh? 
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sunday, June 16, 2019 at 5:47:51 AM UTC-7, rajagopalan madasami 
>>>>>> wrote:
>>>>>>>
>>>>>>> Hi Titus,
>>>>>>>
>>>>>>> I have raised this issue in Geckodriver, but I want to ask you 
>>>>>>> whether this kind of problem can be resolved from programming level in 
>>>>>>> WATIR
>>>>>>>
>>>>>>> Here is the link
>>>>>>>
>>>>>>> https://github.com/mozilla/geckodriver/issues/1573
>>>>>>>
>>>>>> -- 
>>> -- 
>>> Before posting, please read 
>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>  
>>>
>>> In short: search before you ask, be nice.
>>>  
>>> watir-...@googlegroups.com
>>> http://groups.google.com/group/watir-general
>>> watir-...@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-...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/watir-general/60ab76c3-23e8-4b41-802f-56954b662fe4%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/watir-general/60ab76c3-23e8-4b41-802f-56954b662fe4%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/8e2b02f3-5fcc-44d1-a91c-059568756937%40googlegroups.com.


Re: [wtr-general] Re: Click succeeds but action as the result of that click is not triggered

2019-08-02 Thread Titus Fortner
A single click not happening is not what you described in the ticket. Can
you provide the code you used to generate this log and how it is different
from what you expect?


On Thu, Aug 1, 2019, 1:58 AM rajagopalan madasami <
rajagopalanmadas...@gmail.com> wrote:

> I have created a gist here, You can see click is issued but not triggered
> anything. But I am not sure whether you can know whether page has moved to
> the next page or not but I can see while I am running it.
>
> https://gist.github.com/Rajagopalan-M/1e5b68be57a8fa3599c56b9c0364dd6c
>
> On Thursday, 1 August 2019 12:54:56 UTC+5:30, Titus Fortner wrote:
>>
>> I literally and explicitly said the exact opposite of what you did.
>>
>> The logs you provided on Github showed the driver only received one
>> request to click an element. If you expected it to have received more, then
>> you need to figure out why the code did not send more, hence my suggestion
>> to obtain more logging information. Or even better use a debugger to walk
>> through the code to figure out where the disconnect is.
>>
>>
>>
>> On Wednesday, July 31, 2019 at 10:11:30 PM UTC-7, rajagopalan madasami
>> wrote:
>>>
>>>
>>>
>>> On Friday, 19 July 2019 22:39:27 UTC+5:30, Titus Fortner wrote:
>>>>
>>>> The trace you provided only shows a single click, so it isn't a
>>>> geckodriver issue.
>>>>
>>>> Do Watir.logger.level = :debug & Selenium::WebDriver.logger.level =
>>>> :debug
>>>> link to a gist with the output. Something appears to be preventing the
>>>> click command from happening.
>>>>
>>>> >> Something appears to be preventing the click command from
>>>> happening.<<
>>>>
>>>
>>> Then it should be the problem with geckodriver,eh?
>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Sunday, June 16, 2019 at 5:47:51 AM UTC-7, rajagopalan madasami
>>>> wrote:
>>>>>
>>>>> Hi Titus,
>>>>>
>>>>> I have raised this issue in Geckodriver, but I want to ask you whether
>>>>> this kind of problem can be resolved from programming level in WATIR
>>>>>
>>>>> Here is the link
>>>>>
>>>>> https://github.com/mozilla/geckodriver/issues/1573
>>>>>
>>>> --
> --
> Before posting, please read
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>
> 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 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/watir-general/60ab76c3-23e8-4b41-802f-56954b662fe4%40googlegroups.com
> <https://groups.google.com/d/msgid/watir-general/60ab76c3-23e8-4b41-802f-56954b662fe4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/CAKSYPuhYiVYf2unuLGKsg8uZ8aSR0DZLQip5ECMUEe2DD1xT7g%40mail.gmail.com.


[wtr-general] Re: Click succeeds but action as the result of that click is not triggered

2019-08-01 Thread Titus Fortner
I literally and explicitly said the exact opposite of what you did. 

The logs you provided on Github showed the driver only received one request 
to click an element. If you expected it to have received more, then you 
need to figure out why the code did not send more, hence my suggestion to 
obtain more logging information. Or even better use a debugger to walk 
through the code to figure out where the disconnect is.



On Wednesday, July 31, 2019 at 10:11:30 PM UTC-7, rajagopalan madasami 
wrote:
>
>
>
> On Friday, 19 July 2019 22:39:27 UTC+5:30, Titus Fortner wrote:
>>
>> The trace you provided only shows a single click, so it isn't a 
>> geckodriver issue.
>>
>> Do Watir.logger.level = :debug & Selenium::WebDriver.logger.level = :debug
>> link to a gist with the output. Something appears to be preventing the 
>> click command from happening.
>>
>> >> Something appears to be preventing the click command from happening.<<
>>
>
> Then it should be the problem with geckodriver,eh? 
>
>>
>>
>>
>>
>> On Sunday, June 16, 2019 at 5:47:51 AM UTC-7, rajagopalan madasami wrote:
>>>
>>> Hi Titus,
>>>
>>> I have raised this issue in Geckodriver, but I want to ask you whether 
>>> this kind of problem can be resolved from programming level in WATIR
>>>
>>> Here is the link
>>>
>>> https://github.com/mozilla/geckodriver/issues/1573
>>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/b26d5b4e-4c7a-423c-95d1-a49c8913853e%40googlegroups.com.


[wtr-general] Re: Click succeeds but action as the result of that click is not triggered

2019-07-19 Thread Titus Fortner
The trace you provided only shows a single click, so it isn't a geckodriver 
issue.

Do Watir.logger.level = :debug & Selenium::WebDriver.logger.level = :debug
link to a gist with the output. Something appears to be preventing the 
click command from happening.






On Sunday, June 16, 2019 at 5:47:51 AM UTC-7, rajagopalan madasami wrote:
>
> Hi Titus,
>
> I have raised this issue in Geckodriver, but I want to ask you whether 
> this kind of problem can be resolved from programming level in WATIR
>
> Here is the link
>
> https://github.com/mozilla/geckodriver/issues/1573
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/78b0f607-db67-4c77-b416-9856e397a94d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to write and regular expression in WATIR?

2019-07-19 Thread Titus Fortner
Rubular is a great resource for trying things, and there are plenty of 
tutorials: https://rubular.com/

If you need both, you have a lot of options, but: /hello.*username/


On Saturday, June 22, 2019 at 9:52:28 AM UTC-7, rajagopalan madasami wrote:
>
> Consider the below code
>
> b.element(name: /hello|username/).send_keys 'testid'
>
>
> `/hello|username/` represents the or operator, that means it searches the 
> name which is hello or username, how do I write regular expression which 
> search for hello and username?
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/fc6fa147-73ad-4751-8db7-7679aeab07e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: Problem with angular WATIR

2019-05-28 Thread Titus Fortner
Couple things of interest. Protractor is a mostly "dead" project from 
Google right now. The automatic wait code in both it and watir_angular 
still work well for AngularJS, but some Angular 2+ components make it 
impossible to use it. For people who want to test in JavaScript, I 
recommend checking out webdriver.io.



On Tuesday, May 28, 2019 at 12:09:51 PM UTC-5, rajagopalan madasami wrote:
>
> Thank you very much, tomorrow morning I will give you all the detail . 
> It's very important bfir me now because I started automating AngularJS 
> application now. Another person bis automating protrator and I am doing the 
> same in watir.
>
> On Tue, 28 May, 2019, 10:34 PM Titus Fortner,  > wrote:
>
>> Yeah put the details here. I'll see if I can reproduce it: 
>> https://github.com/titusfortner/watir_angular/issues/new
>>
>> On Tuesday, May 28, 2019 at 10:57:15 AM UTC-5, rajagopalan madasami wrote:
>>>
>>> You are asking me to file a bug in GitHub watir page ?
>>>
>>> On Tue, 28 May, 2019, 7:58 PM Titus Fortner,  
>>> wrote:
>>>
>>>> I'm not sure, it might be a w3c change issue. Can you file an issue on 
>>>> github?
>>>>
>>>>
>>>> On Tuesday, May 28, 2019 at 2:02:02 AM UTC-5, rajagopalan madasami 
>>>> wrote:
>>>>>
>>>>> Hi Titus,
>>>>>
>>>>> I started using your gem 'watir_angular'.
>>>>>
>>>>> I have written the following code
>>>>>
>>>>>
>>>>> b.button(name: 'note-menubutton').click
>>>>> WatirAngular.wait_for_angular(b)
>>>>>
>>>>>
>>>>>
>>>>> But this line `WatirAngular.wait_for_angular(b)` is throwing this error
>>>>>
>>>>>
>>>>> Uncaught exception: Timed out after 3 ms
>>>>> WebDriverError@chrome://marionette/content/error.js:179:5
>>>>> ScriptTimeoutError@chrome://marionette/content/error.js:419:5
>>>>> 
>>>>> evaluate.sandbox/timeoutPromise>>>> notify@resource://gre/modules/Timer.jsm:43:17
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/response.rb:72:in
>>>>>  `assert_ok'
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/response.rb:34:in
>>>>>  `initialize'
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/common.rb:88:in
>>>>>  `new'
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/common.rb:88:in
>>>>>  `create_response'
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/default.rb:114:in
>>>>>  `request'
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/common.rb:64:in
>>>>>  `call'
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/bridge.rb:167:in
>>>>>  `execute'
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/w3c/bridge.rb:567:in
>>>>>  `execute'
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/w3c/bridge.rb:310:in
>>>>>  `execute_async_script'
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/common/driver.rb:232:in
>>>>>  `execute_async_script'
>>>>> 
>>>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/watir_angular-0.4.1/lib/watir_angular.rb:13:in
>>>>>  `wait_for_angular'
>>>>> C:/A/StingRay/AppData/example.rb:18:in `'
>>>>>
>>>>>
>>>>> Do you have any idea as to why?
>>>>>
>>>>> -- 
>>>> -- 
>>>> Before posting, please read 
>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-W

Re: [wtr-general] Re: Problem with angular WATIR

2019-05-28 Thread Titus Fortner
Yeah put the details here. I'll see if I can reproduce it: 
https://github.com/titusfortner/watir_angular/issues/new

On Tuesday, May 28, 2019 at 10:57:15 AM UTC-5, rajagopalan madasami wrote:
>
> You are asking me to file a bug in GitHub watir page ?
>
> On Tue, 28 May, 2019, 7:58 PM Titus Fortner,  > wrote:
>
>> I'm not sure, it might be a w3c change issue. Can you file an issue on 
>> github?
>>
>>
>> On Tuesday, May 28, 2019 at 2:02:02 AM UTC-5, rajagopalan madasami wrote:
>>>
>>> Hi Titus,
>>>
>>> I started using your gem 'watir_angular'.
>>>
>>> I have written the following code
>>>
>>>
>>> b.button(name: 'note-menubutton').click
>>> WatirAngular.wait_for_angular(b)
>>>
>>>
>>>
>>> But this line `WatirAngular.wait_for_angular(b)` is throwing this error
>>>
>>>
>>> Uncaught exception: Timed out after 3 ms
>>> WebDriverError@chrome://marionette/content/error.js:179:5
>>> ScriptTimeoutError@chrome://marionette/content/error.js:419:5
>>> 
>>> evaluate.sandbox/timeoutPromise>> notify@resource://gre/modules/Timer.jsm:43:17
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/response.rb:72:in
>>>  `assert_ok'
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/response.rb:34:in
>>>  `initialize'
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/common.rb:88:in
>>>  `new'
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/common.rb:88:in
>>>  `create_response'
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/default.rb:114:in
>>>  `request'
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/common.rb:64:in
>>>  `call'
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/bridge.rb:167:in
>>>  `execute'
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/w3c/bridge.rb:567:in
>>>  `execute'
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/w3c/bridge.rb:310:in
>>>  `execute_async_script'
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/common/driver.rb:232:in
>>>  `execute_async_script'
>>> 
>>> C:/Ruby26/lib/ruby/gems/2.6.0/gems/watir_angular-0.4.1/lib/watir_angular.rb:13:in
>>>  `wait_for_angular'
>>> C:/A/StingRay/AppData/example.rb:18:in `'
>>>
>>>
>>> Do you have any idea as to why?
>>>
>>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-...@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-...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/watir-general/59d05acc-0d40-48f7-99d4-201bc66e520d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/watir-general/59d05acc-0d40-48f7-99d4-201bc66e520d%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/f2ce33cd-11de-4035-aebe-ecff691dd402%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Problem with angular WATIR

2019-05-28 Thread Titus Fortner
I'm not sure, it might be a w3c change issue. Can you file an issue on 
github?


On Tuesday, May 28, 2019 at 2:02:02 AM UTC-5, rajagopalan madasami wrote:
>
> Hi Titus,
>
> I started using your gem 'watir_angular'.
>
> I have written the following code
>
>
> b.button(name: 'note-menubutton').click
> WatirAngular.wait_for_angular(b)
>
>
>
> But this line `WatirAngular.wait_for_angular(b)` is throwing this error
>
>
> Uncaught exception: Timed out after 3 ms
> WebDriverError@chrome://marionette/content/error.js:179:5
> ScriptTimeoutError@chrome://marionette/content/error.js:419:5
> 
> evaluate.sandbox/timeoutPromise notify@resource://gre/modules/Timer.jsm:43:17
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/response.rb:72:in
>  `assert_ok'
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/response.rb:34:in
>  `initialize'
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/common.rb:88:in
>  `new'
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/common.rb:88:in
>  `create_response'
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/default.rb:114:in
>  `request'
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/http/common.rb:64:in
>  `call'
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/bridge.rb:167:in
>  `execute'
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/w3c/bridge.rb:567:in
>  `execute'
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/remote/w3c/bridge.rb:310:in
>  `execute_async_script'
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/selenium-webdriver-3.142.0/lib/selenium/webdriver/common/driver.rb:232:in
>  `execute_async_script'
> 
> C:/Ruby26/lib/ruby/gems/2.6.0/gems/watir_angular-0.4.1/lib/watir_angular.rb:13:in
>  `wait_for_angular'
> C:/A/StingRay/AppData/example.rb:18:in `'
>
>
> Do you have any idea as to why?
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/59d05acc-0d40-48f7-99d4-201bc66e520d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to call the custom tags?

2019-05-28 Thread Titus Fortner
I'd need to see the underlying html to know for sure, but it looks like you 
want to specify the tag name of the following sibling 
`following_sibling(tag_name: 'div')`



On Tuesday, May 28, 2019 at 8:45:37 AM UTC-5, rajagopalan madasami wrote:
>
> Justin,
>
> Can you please help me to write this code in watir?
>
> b.span(xpath: 
> "//label[@title='Subject']/following-sibling::div/lf-select/div/span").click
>
>
> I have tried this
>
> b.label(title: 'Subject').following_sibling.element(tag_name: 
> 'lf-select').div.span.click
>
> But it's not working. 
>
> Can you help me here?
>
>
> On Tuesday, 28 May 2019 18:56:52 UTC+5:30, Justin Ko wrote:
>>
>> For custom elements, you will need to use the #element method:
>>
>> b.element(tag_name: 'lf-select')
>>
>> Justin
>>
>>
>> On Tuesday, May 28, 2019 at 1:15:05 AM UTC-4, rajagopalan madasami wrote:
>>>
>>> Hi,
>>>
>>> I have a custom tag named `lf-select`
>>>
>>> Can't I call in WATIR like
>>>
>>> b.lf_select()
>>>
>>> Or something like that? Or Is there anyway?
>>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/watir-general/792fb46a-fcaf-44ef-a502-f11fa5d223fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: Ruby 2.6 is supported

2019-04-29 Thread Titus Fortner
Yeah, I think it is something weird in our specs; I still need to track it 
down.

On Monday, April 29, 2019 at 10:56:44 AM UTC-5, rajagopalan madasami wrote:
>
> No, I remember you said not all the specs are passed.
>
> On Mon, 29 Apr, 2019, 9:20 PM Titus Fortner,  > wrote:
>
>> It should work. Are you noticing an issue?
>>
>> On Monday, April 29, 2019 at 5:48:59 AM UTC-5, rajagopal...@gmail.com 
>> wrote:
>>>
>>> Hi Titus,
>>>
>>> Can I use Ruby 2.6? WATIR is supported with Ruby 2.6?
>>>
>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-...@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-...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Ruby 2.6 is supported

2019-04-29 Thread Titus Fortner
It should work. Are you noticing an issue?

On Monday, April 29, 2019 at 5:48:59 AM UTC-5, rajagopal...@gmail.com wrote:
>
> Hi Titus,
>
> Can I use Ruby 2.6? WATIR is supported with Ruby 2.6?
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] watir_angular

2019-04-23 Thread Titus Fortner
It's not a project, it's pretty much just a convenient way to inject the
protractor implemented angular queue check. It will work great for
angularjs, possibly not as well for later versions of angular.

On Tue, Apr 23, 2019, 2:40 AM  wrote:

> Hi Titus,
>
> It seems like you have created a watir project for angular. Are you still
> supporting to that project? Can I start working on that?
>
> --
> --
> Before posting, please read
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] What is the default element and page wait in Watir. Do we have to explicitly set PageObject.default_element_wait?

2019-04-14 Thread Titus Fortner
Yes, watir default is 30 seconds, so likely that line is setting it to 10.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Cant capture alert using "alert" method of Page Object

2019-04-10 Thread Titus Fortner
I don't like the way Page Object uses blocks... In Watir it is simply:

alert_text = @browser.alert.text
@browser.alert.dismiss


On Wed, Apr 10, 2019 at 9:23 PM NaviHan  wrote:
>
> Im trying to capture the alert text and dismiss the alert using the "alert" 
> method
>
>   def test
> @browser.div(:class => 'address-details', :index =>0).click
> alert_text = alert do
>   @browser.div(:class => 'select-checkbox', :index =>1).click
> end
> sleep 10
> puts alert_text
>
>
>   end
>
>
> I have passed @browser.div(:class => 'select-checkbox', :index =>1).click  
> into the alert method which actually triggers the alert
>
> As per the implementation this should capture the alert text and click OK
>
> However I'm getting this error
>
> elenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert 
> text : This address cannot be used.}
>   (Session info: chrome=73.0.3683.86)
>   (Driver info: chromedriver=2.38.552522 
> (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 10.0.17134 
> x86_64)
>
>
> A video of the issue here @ 
> https://drive.google.com/file/d/1Di9idgfqjE7TLSn5QG7pgUFxpln3kben/view?usp=sharing
>
> --
> --
> Before posting, please read 
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: How to keep the Watir browser run on the backend?

2019-04-10 Thread Titus Fortner
I think it needs to be two strings separated by a comma. I have no idea if
it actually works.

On Wed, Apr 10, 2019, 11:33 AM NaviHan  wrote:

> Tried this, browser didnt minimize
>
>   args = ['--allow-running-insecure-content --window-position=-3000, 0']
>   browser = Watir::Browser.new :chrome, options: {args: args}
>
> Titus is this correct?
> On Wednesday, 10 April 2019 22:42:13 UTC+10, watirQ wrote:
>>
>> Experts
>>
>> Each time when use .goto or open a new tab, the browser window will lump
>> to the frontend of the screen. How to keep the Watir browser run on the
>> backend, so that will  not interrupt other works
>>
>> Thanks
>>
> --
> --
> Before posting, please read
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: Is there a way to duplicate a tab using Watir

2019-04-10 Thread Titus Fortner
Does the JavaScript work in all browsers? I'm reluctant to add browser
specific features if not. If so, make a PR and we can evaluate it. It is
low on my list of priorities for code at the moment.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: Is there a way to duplicate a tab using Watir

2019-04-10 Thread Titus Fortner
The issue is that it isn't in the w3c: https://w3c.github.io/webdriver/
Probably because not all browsers implement that functionality, so it 
didn't make sense to put it in the spec.
You can request the feature in the spec, but it won't happen any time soon.



On Wednesday, April 10, 2019 at 11:43:39 AM UTC-5, rajagopalan madasami 
wrote:
>
> Yes, driver is not giving any way to this Job. Neither chrome nor 
> geckodriver. You may ask them to add it in github!
>
> Here 
> https://github.com/mozilla/geckodriver/issues
>
> For Chrome here 
>
> https://bugs.chromium.org/p/chromedriver/issues/list
>
>
> On Wed, 10 Apr, 2019, 10:05 PM NaviHan, > 
> wrote:
>
>> I want to duplicate the browser in a new tab. Not open a blank new tab.
>>
>> And are we sure that javascript is the only way to open a new tab?
>>
>> On Wednesday, 10 April 2019 13:39:32 UTC+10, NaviHan wrote:
>>>
>>> Is there a way to duplicate a tab using Watir?
>>>
>>> (in chrome, right click on tab>Duplicate tab)
>>>
>>> I know we can use the javascript to open a new tab?
>>> Even if its new tab is there a Watir way to do that?
>>>
>>> @browser.execute_script("window.open('http://www.google.com', '_blank')")
>>>
>>>
>>>
>>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-...@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-...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: How to keep the Watir browser run on the backend?

2019-04-10 Thread Titus Fortner
You can set it up to move off the screen when it opens by passing in the 
args to the ChromeOptions class: 
https://peter.sh/experiments/chromium-command-line-switches/#window-position

it probably will still steal focus momentarily even if it isn't on top of 
your screen,



On Wednesday, April 10, 2019 at 9:13:41 AM UTC-5, rajagopalan madasami 
wrote:
>
> But it will still shows up for some seconds.
>
> On Wed, 10 Apr, 2019, 7:42 PM NaviHan, > 
> wrote:
>
>> Try this after you open the browser
>> browser.window.move_to(-3000, 0)
>>
>> This will minimize the window
>>
>> On Wednesday, 10 April 2019 22:42:13 UTC+10, watirQ wrote:
>>>
>>> Experts 
>>>
>>> Each time when use .goto or open a new tab, the browser window will lump 
>>> to the frontend of the screen. How to keep the Watir browser run on the 
>>> backend, so that will  not interrupt other works
>>>
>>> Thanks
>>>
>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-...@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-...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Xpath as a selector in hash format. Am I doing it wrong?

2019-03-27 Thread Titus Fortner
:xpath as key is "locate an element with provided xpath value"
"xpath" as key is "locate an element with an attribute of 'xpath' that
has the provided value"

The goal of Watir, in general, though, is to make it so you should
never need to use XPath.

On Wed, Mar 27, 2019 at 11:24 AM Steve Parrado  wrote:
>
> So while tooling around on some stuff, I was trying different ways to use 
> selectors in conjunction with some array values.  I came across something 
> that I can't quite figure out.
>
> I recreated it using http://automationpractice.com/index.php to be able to 
> ask in general without need for people to be in my environment to emulate.
>
> So some details:
> Ruby version:  ruby 2.5.3p105 (2018-10-18 revision 65156) [x64-mingw32]
> Watir version:  6.11.0
> Chromedriver version:  2.46.628402
>
> I know I am not at the latest for Watir and Ruby, I've had to lock in these 
> version.
>
> In anycase, at the url I mentioned above 
> http://automationpractice.com/index.php I inspected the shopping cart element
> I noted that the element had a title of "View my shopping cart" and I copied 
> the xpath of "//*[@id='header']/div[3]/div/div/div[3]/div/a" (double quotes 
> changed to single
>
> The oddity that I am trying to figure out is this:
>
> @browser.element(title: "View my shopping cart").present?  - evaluates true
> @browser.element(:title, "View my shopping cart").present? = evaluates true
>  @browser.element("title" => "View my shopping cart").present? - evaluates 
> true
>
> however,
>
> @browser.element(xpath: 
> "//*[@id='header']/div[3]/div/div/div[3]/div/a").present? - evaluates true
> @browser.element(:xpath, 
> "//*[@id='header']/div[3]/div/div/div[3]/div/a").present? - evaluates true
> @browser.element("xpath" => 
> "//*[@id='header']/div[3]/div/div/div[3]/div/a").present? - evaluates false
>
> I tried this with some other elements to similar results
>
> @browser.button(:name, "submit_search").present? - true
> @browser.button(name: "submit_search").present? - true
> @browser.button("name" => "submit_search").present? -true
>
> @browser.button(xpath: "//*[@id='searchbox']/button").present? - true
> @browser.button(:xpath, "//*[@id='searchbox']/button").present? - true
> @browser.button("xpath" => "//*[@id='searchbox']/button").present? - false
>
> Can anyone enlighten me on what I am doing wrong?
>
> Thanks,
> Steve
>
> --
> --
> Before posting, please read 
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] How to check if a collection is present in PageObject?

2019-03-26 Thread Titus Fortner
any? none? empty? And any enumerator methods should work.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Which is better in PageObject model, using id, class, name to identify elements or using css to identify elements

2019-03-26 Thread Titus Fortner
The other reason to perhaps prefer css is that Page Object gem makes using 
nested elements harder.

span(:remove_all_link, :css=> ".wishlist-remove-all span")
I think would need to look like:

element(:wishlist_remove_all, :class => "wishlist-remove-all") 
span(:remove_all_link){ wishlist_remove_all_element.span } 

Justin is there an easier way to do this in PO gem?





On Tuesday, March 26, 2019 at 11:39:39 AM UTC-5, Justin Ko wrote:
>
> In most cases, it is simply a matter of personal preference. There is 
> usually no technical difference between between using CSS/XPath vs 
> attributes. To me, the most important thing is to be consistent as an 
> organization so that code is consistent, which makes the code easier to 
> read/maintain. I would push using attributes as easier to read and less 
> error prone. However, I have worked with people coming from Capybara that 
> feel that CSS expressions are easier to read/use.
>
> That said, there is one place where using CSS/XPath is the better solution 
> - creating a collection of nested elements without the same ancestors.
>
> For example, let's say you have the following HTML:
>
>
> 
>   
> link A
>   
>   
> link B
>   
> 
>
> Your current accessor, will match *2* links:
>
> links(:product_names, :css => ".price-and-quick-add-button-wrapper 
> a.name-link")
>
> Unlike the CSS-locator, nesting Watir's element calls only looks in the 
> first matching element. Therefore, you would only get *1* match if you 
> tried:
>
> links(:product_names) { div(class: "price-and-quick-add-button-wrapper").
> links(class: "name-link") }
>
> To get the *2* links without CSS/XPath you would need to make some ugly 
> iteration of elements, which is harder to read/write and worse with more 
> levels of nesting:
>
> links(:product_names) { divs(class: "price-and-quick-add-button-wrapper").map 
> { |div| div.links(class: "name-link") }.flatten }
>
> Of course, this assumes you're stuck with the HTML you have. The better 
> answer would be to add more attributes so that you can locate the links 
> directly (ie not deal with nesting).
>
> - Justin
>
>
> On Tuesday, March 26, 2019 at 5:19:06 AM UTC-4, NaviHan wrote:
>>
>> Hi Titus
>>
>> Today I saw a team member defining elements like this
>>
>> +  a(:start_shopping_link, :css => "a.start-shopping")
>>
>>
>> 
>>  
>> 
>>
>> +  links(:product_names, :css => ".price-and-quick-add-button-wrapper 
>> a.name-link")
>>
>>
>> 
>>  
>> 
>>
>> +  links(:product_thumbnails, :css => "a.thumb-link")
>>
>>
>> 
>>  
>> 
>>
>> +  span(:remove_all_link, :css=> ".wishlist-remove-all span")
>>
>>
>> Heavy use of css.
>> I cant tell them why they should use css :-)
>>
>> Could you please let me know the disadvantage here?
>>
>> On Sunday, 24 March 2019 17:15:53 UTC+11, NaviHan wrote:
>>>
>>> I have seen in my project using css to identify elements using 
>>> PageObject.
>>> I always use attributes like id, class and name to identify elements.
>>>
>>> Which is the better way and why?
>>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Which is better in PageObject model, using id, class, name to identify elements or using css to identify elements

2019-03-24 Thread Titus Fortner
The Watir API is designed such that you shouldn't ever need to use CSS (or 
XPath). Especially with the latest versions where there is no performance 
penalty to nesting elements. Presumably a Hash of attribute or class 
key/value pairs is easier to read and parse than CSS selector annotation.

Another thing to consider if you have access to the underlying markup, is 
to use a unique custom attribute (I recommend `data-test`) for everything 
you want to interact with on a page for a test. ID is becoming less common 
because of single page applications, and class values are there for 
formatting the site, not for providing unique locators for elements for 
your tests.





On Sunday, March 24, 2019 at 1:15:53 AM UTC-5, NaviHan wrote:
>
> I have seen in my project using css to identify elements using PageObject.
> I always use attributes like id, class and name to identify elements.
>
> Which is the better way and why?
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: How do i set selenium script time out?

2019-02-26 Thread Titus Fortner
Try setting w3c: true in Chrome options, maybe I'm using the wrong signature 
for legacy Chrome. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How do i set selenium script time out?

2019-02-26 Thread Titus Fortner
I don't have time to test it right now, but it might be a bug. Try 
Selenium::Webdriver.logger.level = :info
See if the timeout information is showing up when you initialize the browser. 

It's possible that watir isn't seeing both right now. I'm working on fixing it. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: how can I set chrome to a use a specific version?

2019-02-11 Thread Titus Fortner
You install the exact version of Chrome you want on your machine, or you 
install it separately and set the path with: 
`Selenium::WebDriver::Chrome.path = "/path/to/my/chrome/binary"`


On Wednesday, February 6, 2019 at 3:53:50 PM UTC-6, Joe Fl wrote:
>
> Hi all.
>
> I would like to set my watir spec tests to use chrome 'Version 
> 72.0.3626.96 (Official Build) (64-bit)' and it is currently running 'Version 
> 72.0.3626.96 (Official Build) (64-bit)'.  
>
> How do I accomplish this?  
>
> Here is our current setup:
>
> args = [
>   
> ]
> @opts = Selenium::WebDriver::Chrome::Options.new(args: args)
> prefs = {
> }
> @opts.add_option("prefs", prefs)
> Watir.default_timeout = 10 
> @browser = Watir::Browser.new :chrome, options: @opts
>
> I am seeing a tableau error on the latest version which I believe is 
> preventing tabs from displaying for a report.  Though if I navigate o the 
> same report using my own script those tabs display (which uses the version 
> of chrome on my machine).
>
>
> any help would be greatly appreciated.
>
> Thank you,
> Joe
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: List of items that refresh every second

2019-02-11 Thread Titus Fortner
I'm not certain I understand what you are looking for.

For a specific test run you can get a progress bar with an RSpec formatter 
like https://github.com/thekompanee/fuubar

Most of the time, though "Jobs" are "Test Suite Executions" and status is 
handled by CI tools like Jenkins.



On Wednesday, February 6, 2019 at 5:26:49 PM UTC-6, Joe Fl wrote:
>
> As a user I want to confirm the job I requested has completed with results.
>
> The list contains many jobs in many different statuses.  
>
> status is as follows: pending, running, result
>
>
> On Tuesday, January 29, 2019 at 3:13:05 AM UTC-5, Lakshya Kapoor wrote:
>>
>> What exactly are you trying to test with the jobs? We'll need a proper 
>> test case to be able to help you.
>>
>> On Monday, January 28, 2019 at 11:23:25 AM UTC-8, Joe Fl wrote:
>>>
>>> Hi all,
>>>
>>> I have a list of jobs being executed that show the progress of the job. 
>>>  This list refreshes every second and I am wondering if anyone automated 
>>> this before.  I will create then execute the job and continue look at the 
>>> list of jobs until its results return.  The other challenge is my original 
>>> job could move from the #1 spot to lower in the list.
>>>
>>> Any thoughts on how to approach this would be greatly appreciated.
>>>
>>> Thank you,
>>> Joe
>>>
>>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] WATIR can be used for AngularJS?

2019-01-31 Thread Titus Fortner
This gem used to be a bigger deal because Watir required attribute values 
to be defined directly. Now that we've opened this up more, all that you 
get from watir_angular is to be able to inject the automatic waiting calls 
that are found in Protractor. This may or may not be useful depending on 
the specific angular application.



On Tuesday, January 29, 2019 at 7:15:01 AM UTC-8, Joe Fl wrote:
>
> Hi,
>
> Yes, there is watir_angular.
>
> https://github.com/titusfortner/watir_angular
>
> Joe
>
> On Tue, Jan 29, 2019, 10:10 AM  
> wrote:
>
>> Hi Titus,
>>
>> Is it possible to automate AngularJs application using WATIR? Any gem is 
>> available?
>>
>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Setting Firefox Download folder

2019-01-31 Thread Titus Fortner
Yeah, I don't think profiles are working ideally in Firefox right now, I'm 
still investigating some of that right now.

You want to pass this in as a `prefs` value:

Not asking should be default?

So I think it should be this:
Watir::Browser.new(:firefox, options: {prefs: 
{"browser.download.folderList" => "/path/to/downloads"}})

All the pref options should be here:
http://kb.mozillazine.org/About:config_entries



On Saturday, December 29, 2018 at 4:59:37 AM UTC-8, rajagopal...@gmail.com 
wrote:
>
> I have succeeded to set the download folder for chrome and it's perfectly 
> doing it's Job, but I couldn't do it for firefox
>
> I have written the following code for chrome
>
> client = Selenium::WebDriver::Remote::Http::Default.new
> client.read_timeout = @Page_Load # seconds
> prefs = {
>  download: {
>  prompt_for_download: false,
>  default_directory: File.expand_path("../../../AppData/Downloads", __FILE__)
>  }
> }
> @b = Watir::Browser.new :chrome, http_client: client, args: 
> ['user-data-dir=C:\Rajagopalan'], options: {prefs: prefs}
>
> It works perfectly but when I try to set same for firefox by the following 
> code
>
> puts 'Test Starts in Latest Firefox'
> profile = 
> Selenium::WebDriver::Firefox::Profile.new('C:\Users\rajagopalan.m\AppData\Roaming\Mozilla\Firefox\Profiles\5yit4mlq.default')
> profile['browser.download.dir'] = 
> File.expand_path("../../../AppData/Downloads", __FILE__)
> profile['browser.helperApps.neverAsk.saveToDisk'] = 'raj'
> options = Selenium::WebDriver::Firefox::Options.new
> options.profile = profile
>
> client = Selenium::WebDriver::Remote::Http::Default.new
> client.read_timeout = @Page_Load
> @b = Watir::Browser.new :firefox, http_client: client, options: options
>
> It's not working as it's working for Chrome. Can someone help me? 
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Error

2019-01-31 Thread Titus Fortner
I'm not sure if you got this figured out, this is the best I have as an 
answer, though it looks like it might have been headless 
issue: 
https://stackoverflow.com/questions/52281367/cache-is-not-initialized-cannot-retrieveentry-error-for-selenium-chromedriver-w


On Friday, December 28, 2018 at 6:05:48 AM UTC-8, rajagopal...@gmail.com 
wrote:
>
> Hi, Yes, as you are saying, it's only happening in Chrome. I had been 
> using the version of 2.43 and now I have upgraded to the recent version 
> 2.45 but still I face the same problem. And no, I am not using headless 
> mode. 
>
> On Friday, 28 December 2018 18:59:43 UTC+5:30, Titus Fortner wrote:
>>
>> Is this headless & Chrome? There is a chromedriver bug, check stack 
>> overflow for workarounds...
>>
>>
>>
>> On Friday, December 28, 2018 at 1:57:53 AM UTC-6, rajagopal...@gmail.com 
>> wrote:
>>>
>>> Hi Titus,
>>>
>>> When I run my project, this message always shows up before I run my 
>>> program but no hindrance to my running. Do you have any idea as to why this 
>>> shows up?
>>>
>>>
>>> DevTools listening on ws://
>>> 127.0.0.1:59735/devtools/browser/8c6c9817-6a06-465a-8ff0-9950fcbc8149
>>> [6172:12536:1228/132153.702:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.747:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.775:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.781:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.781:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.782:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.782:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.782:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.782:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.783:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>>
>>>
>>>
>>>
>>>
>>> [6172:12536:1228/132153.783:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.783:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.783:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.784:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.784:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.784:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>> [6172:12536:1228/132153.784:ERROR:in_progress_cache_impl.cc(203)] Cache 
>>> is not initialized, cannot RetrieveEntry.
>>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: What happened to "cheezy"

2019-01-31 Thread Titus Fortner
He's been keeping busy. He changed companies a couple times, and is 
teaching a BDD workshop in Toronto next 
month: https://www.industriallogic.com/canada/

He's posted some things here:
https://www.linkedin.com/in/jeffmorgan5/detail/recent-activity/

There are probably more conversations going on in Twittersphere than 
blogosphere at this point.



On Thursday, January 31, 2019 at 2:57:50 AM UTC-8, NaviHan wrote:
>
> Just curious , whats Jeff Morgan doing these days? There has been no posts 
> on his website cheezyworld since March 2017.
> Missing his articles on Test Automation.
>
> Is there anyone Automation Gurus we can follow for day to day reading?
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Error

2018-12-28 Thread Titus Fortner
Is this headless & Chrome? There is a chromedriver bug, check stack 
overflow for workarounds...



On Friday, December 28, 2018 at 1:57:53 AM UTC-6, rajagopal...@gmail.com 
wrote:
>
> Hi Titus,
>
> When I run my project, this message always shows up before I run my 
> program but no hindrance to my running. Do you have any idea as to why this 
> shows up?
>
>
> DevTools listening on ws://
> 127.0.0.1:59735/devtools/browser/8c6c9817-6a06-465a-8ff0-9950fcbc8149
> [6172:12536:1228/132153.702:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.747:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.775:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.781:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.781:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.782:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.782:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.782:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.782:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.783:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
>
>
>
>
>
> [6172:12536:1228/132153.783:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.783:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.783:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.784:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.784:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.784:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
> [6172:12536:1228/132153.784:ERROR:in_progress_cache_impl.cc(203)] Cache is 
> not initialized, cannot RetrieveEntry.
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: b.select_list.select is not working in 6.16

2018-12-24 Thread Titus Fortner
Watir 6.16 is now trying to find the option directly without making
extra wire calls to find the Select List first. It's possible that
something was missed in our test suite, but we need to actually be
able to reproduce the issue you are seeing.

http://sscce.org/

ideally you give us a script that we can copy/paste into irb and
immediately see the issue.
(this is a great example: https://github.com/watir/watir/issues/841)

On Sun, Dec 23, 2018 at 8:27 AM  wrote:
>
> Hi Justin Ko,
>
> What other detail you specifically want from me ? Actually the same code I am 
> running in WATIR 6.14 and it's running fine but it's throwing error when I 
> use WATIR 6.16.
>
>
> On Friday, 21 December 2018 21:07:33 UTC+5:30, Justin Ko wrote:
>>
>> Hi Raj,
>>
>> I think we still need more details on how to reproduce the problem.
>>
>> I do not see anything obviously wrong from the logs. As well, given the page:
>>
>> 
>>   Any
>>   Mr
>> 
>>
>> Selection is working:
>>
>> @b.select_list(id: "salutation").select 'Mr'
>> p @b.select_list(id: "salutation").selected_options.map(&:text)
>> #=> ["Mr"]
>>
>> It would help if you can create an isolated example that reproduces the 
>> issue.
>>
>> Thanks,
>> Justin
>>
>>
>> On Thursday, December 20, 2018 at 11:52:23 PM UTC-5, rajagopalan madasami 
>> wrote:
>>>
>>> Hi Titus, I have given the details in my last mail. Can you look into that ?
>>>
>>> On Wed 19 Dec, 2018, 9:43 PM Titus Fortner >>>
>>>> Our specs are all passing, so you need to provide a reproducible issue
>>>> so we can add the use case to our test suite.
>>>>
>>>> On Wed, Dec 19, 2018 at 8:50 AM Justin Ko  wrote:
>>>> >
>>>> > Can you elaborate on what is not working?
>>>> >
>>>> > I get the same behaviour in 6.14 and 6.16 when running the below script 
>>>> > - ie `browser.select_list.select` does not select anything.
>>>> >
>>>> > gem 'watir', '=6.14'
>>>> > require 'watir'
>>>> >
>>>> > browser = Watir::Browser.new
>>>> > browser.goto 'test_page.html'
>>>> >
>>>> > browser.select_list.select('b')
>>>> > p browser.select_list.selected_options.map(&:text)
>>>> > #=> ["b"]
>>>> >
>>>> > browser.select_list.select
>>>> > p browser.select_list.selected_options.map(&:text)
>>>> > #=> ["b"]
>>>> >
>>>> > Thanks,
>>>> > Justin
>>>> >
>>>> >
>>>> > On Wednesday, December 19, 2018 at 5:45:43 AM UTC-5, 
>>>> > rajagopal...@gmail.com wrote:
>>>> >>
>>>> >> hi Titus,
>>>> >>
>>>> >> b.select_list().select is not working in 6.16 but it's working 6.14.
>>>> >>
>>>> >> So I have written
>>>> >>
>>>> >> `b.select_list().option.select` and it's working fine. So it's a clear 
>>>> >> bug in WATIR 6.16
>>>> >
>>>> > --
>>>> > --
>>>> > Before posting, please read 
>>>> > https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>> > In short: search before you ask, be nice.
>>>> >
>>>> > watir-...@googlegroups.com
>>>> > http://groups.google.com/group/watir-general
>>>> > watir-genera...@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-genera...@googlegroups.com.
>>>> > For more options, visit https://groups.google.com/d/optout.
>>>>
>>>> --
>>>> --
>>>> Before posting, please read 
>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>> In short: search before you ask, be nice.
>>>>
>>>> watir-...@googlegroups.com
>>>> http://groups.google.com/group/watir-general
>>>> watir-genera...@googlegroups.com
>>>&g

Re: [wtr-general] Re: b.select_list.select is not working in 6.16

2018-12-19 Thread Titus Fortner
Our specs are all passing, so you need to provide a reproducible issue
so we can add the use case to our test suite.

On Wed, Dec 19, 2018 at 8:50 AM Justin Ko  wrote:
>
> Can you elaborate on what is not working?
>
> I get the same behaviour in 6.14 and 6.16 when running the below script - ie 
> `browser.select_list.select` does not select anything.
>
> gem 'watir', '=6.14'
> require 'watir'
>
> browser = Watir::Browser.new
> browser.goto 'test_page.html'
>
> browser.select_list.select('b')
> p browser.select_list.selected_options.map(&:text)
> #=> ["b"]
>
> browser.select_list.select
> p browser.select_list.selected_options.map(&:text)
> #=> ["b"]
>
> Thanks,
> Justin
>
>
> On Wednesday, December 19, 2018 at 5:45:43 AM UTC-5, rajagopal...@gmail.com 
> wrote:
>>
>> hi Titus,
>>
>> b.select_list().select is not working in 6.16 but it's working 6.14.
>>
>> So I have written
>>
>> `b.select_list().option.select` and it's working fine. So it's a clear bug 
>> in WATIR 6.16
>
> --
> --
> Before posting, please read 
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert text : Bad response - parser error!}

2018-12-06 Thread Titus Fortner
Like I said, this is a real error, so you need to talk to your devs to figure 
out why you're getting this. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert text : Bad response - parser error!}

2018-12-04 Thread Titus Fortner
Put that line of code in your before hook. When an unexpected alert pops 
up, it'll tell you what exactly was just sent to the browser that caused 
it. It spits out a lot of text to console, so hopefully the issue is 
happening frequently enough that you can turn it on for a short time and 
pinpoint the issue.


On Tuesday, December 4, 2018 at 8:02:39 PM UTC-7, NaviHan wrote:
>
> Thanks Titus, Yes I know the issue with, "Watir::Wait.until {element}" this 
> is all over our automation code , the previous automation tester did this 
> practise. In on my list to clean this up 
>
> But sorry I didnt quite understand the statement "Also log the wire calls 
> getting sent to the driver to see exactly what is causing the alert 
> (`Selenium::WebDriver.logger.level = :info`)". Could you please a bit more 
> clear..
>
> On Wednesday, 5 December 2018 13:31:56 UTC+11, NaviHan wrote:
>>
>>  Im having a tough time with this intermittent error I get on checkout 
>> page once all the details are filled and customer hits payment button.
>>
>> Sometimes
>> Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {
>> Alert text : Bad response - parser error!}
>>
>>  
>>
>>   (Session info: chrome=70.0.3538.102) 
>>
>>   (Driver info: chromedriver=2.41.578737 (
>> 49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 
>> SP1 x86_64) 
>>
>> ./features/support/pages/Frontend/Cotton_On/Thankyou_Page.rb:91:in 
>> `find_dw_order_number' 
>>
>>
>> ./features/step_definitions/Checkout_Page_steps.rb:1395:in `block (2 
>> levels) in ' 
>>
>> ./features/step_definitions/Checkout_Page_steps.rb:1394:in `/^Thankyou 
>> page is shown with details for the user$/' 
>>
>> ./features/Giftcards-AU.feature:233:in `Then Thankyou page is shown with 
>> details for the user'
>>
>>  
>>
>> Sometimes
>>
>> Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {
>> Alert text : Couldn't load credit card!}
>>
>>  
>>
>>   (Session info: chrome=70.0.3538.102) 
>>
>>   (Driver info: chromedriver=2.41.578737 
>> (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 SP1 
>> x86_64)
>>
>>
>>  
>>
>> In order for the dev to have a look I need to give them the browser 
>> console logs at the point of failure. What happens is that some times I get 
>> the error on "wait_for_ajax" and some time on "wait_and_click" method. The 
>> test exits abruptly with the errors above and no screenshots ate taken
>>
>> Is there a way I can get the browser console logs at this point?
>>
>>
>>
>> def place_order
>>  wait_for_ajax
>>  wait_and_click place_order_btn_element
>> end
>>
>>
>> def wait_and_click element
>>  begin
>>  retries ||= 0
>>  Watir::Wait.until {element}.focus
>>  Watir::Wait.until {element}.click
>>  rescue Selenium::WebDriver::Error::UnknownError
>>  retry if (retries += 1) < $code_retry
>>  rescue Watir::Exception::UnknownObjectException
>>  retry if (retries += 1) < $code_retry
>>  end
>> end
>>
>>
>>
>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert text : Bad response - parser error!}

2018-12-04 Thread Titus Fortner
The issue is that sometimes an alert has popped up. Whenever an alert is 
present, the driver will not accept any commands that do not deal with that 
alert. Just like a user can't do anything on a site without dismissing it. 
That includes screenshots. Rescuing the error won't help if you just send 
another non-alert handling command.

These appear to be "real" errors as in the site appears to be responding 
improperly and your tests are finding an actual issue.

As the developer what would cause a JS alert of `Bad response - parser 
error!` or `Couldn't load credit card! ` since these Strings are somewhere 
in your app code. Also log the wire calls getting sent to the driver to see 
exactly what is causing the alert (`Selenium::WebDriver.logger.level = 
:info`)


As a side note, Watir is lazy loaded, so this code won't actually do 
anything.
Watir::Wait.until {element}

`element` object instance will immediately return a truthy value and no 
waiting happens.

It shouldn't matter, though, because `#focus` will automatically wait for 
the element to exist and `#click` will automatically wait for the element 
to be displayed.




On Tuesday, December 4, 2018 at 7:31:56 PM UTC-7, NaviHan wrote:
>
>  Im having a tough time with this intermittent error I get on checkout 
> page once all the details are filled and customer hits payment button.
>
> Sometimes
> Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {
> Alert text : Bad response - parser error!}
>
>  
>
>   (Session info: chrome=70.0.3538.102) 
>
>   (Driver info: chromedriver=2.41.578737 (
> 49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 
> SP1 x86_64) 
>
> ./features/support/pages/Frontend/Cotton_On/Thankyou_Page.rb:91:in 
> `find_dw_order_number' 
>
>
> ./features/step_definitions/Checkout_Page_steps.rb:1395:in `block (2 
> levels) in ' 
>
> ./features/step_definitions/Checkout_Page_steps.rb:1394:in `/^Thankyou 
> page is shown with details for the user$/' 
>
> ./features/Giftcards-AU.feature:233:in `Then Thankyou page is shown with 
> details for the user'
>
>  
>
> Sometimes
>
> Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {
> Alert text : Couldn't load credit card!}
>
>  
>
>   (Session info: chrome=70.0.3538.102) 
>
>   (Driver info: chromedriver=2.41.578737 
> (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 SP1 
> x86_64)
>
>
>  
>
> In order for the dev to have a look I need to give them the browser 
> console logs at the point of failure. What happens is that some times I get 
> the error on "wait_for_ajax" and some time on "wait_and_click" method. The 
> test exits abruptly with the errors above and no screenshots ate taken
>
> Is there a way I can get the browser console logs at this point?
>
>
>
> def place_order
>  wait_for_ajax
>  wait_and_click place_order_btn_element
> end
>
>
> def wait_and_click element
>  begin
>  retries ||= 0
>  Watir::Wait.until {element}.focus
>  Watir::Wait.until {element}.click
>  rescue Selenium::WebDriver::Error::UnknownError
>  retry if (retries += 1) < $code_retry
>  rescue Watir::Exception::UnknownObjectException
>  retry if (retries += 1) < $code_retry
>  end
> end
>
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Issue with watir index or Am I doing something wrong

2018-11-22 Thread Titus Fortner
This code looks for all nested divs, not just divs that are direct 
children. This is the 2nd div: Card

The code is looking for a div nested under that, which isn't there.



On Thursday, November 22, 2018 at 8:06:07 PM UTC-6, NaviHan wrote:
>
> Having trouble using index.
>
> I have a section of a page as below.
> 
> 
> Card
> Amount Taken
> 
>  ="display: flex;">
> ...163867647149
> $20.00
> 
>  data-gcid="2790030163867647149">
> 
> 
> 
> 
> 
>  style="display: flex;">
> ...169169063156
> $25.90
> 
> ($74.10 left on card)
> 
> 
> 
>  data-gcid="2790030169169063156">
>  >
> 
> 
> 
> 
> 
>
>
> The pageobject is defined as
>
> div(:applied_gift_cards, :class => 'gc-list')
>
>
>
>
> And Im trying to access "...163867647149 " and "$20.00" as which gave 
> error
>
> return applied_gift_cards_element.div_element(:index => 1).div_element(:index 
> =>0).text
>
> return applied_gift_cards_element.div_element(:index => 1).div_element(:index 
> =>0).text
>
> Watir::Exception::UnknownObjectException: timed out after 30 seconds, 
> waiting for #"gc-list", 
> :tag_name=>"div"} --> {:index=>1, :tag_name=>"div"} --> {:index=>0, 
> :tag_name=>"div"}> to be located
>
> When printing the same element actually prints the Pageobect
> puts applied_gift_cards_element.div_element(:index => 1).div_element(:index 
> =>0)
> #
>
>
> A puts of the following printed as below which is again confusing
>
> puts applied_gift_cards_element.div_element(:index => 0).inner_html
> puts applied_gift_cards_element.div_element(:index => 1).inner_html
> puts applied_gift_cards_element.div_element(:index => 2).inner_html
> puts applied_gift_cards_element.div_element(:index => 3).inner_html
>
> Card
>  Amount Taken
> Card
> Amount Taken
> ...163867647149$20.00 type="button" class="remove-gift-cert pointer" 
> data-gcid="2790030163867647149">
>
>
>
>
> Am I doing something wrong here?
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: obsured? method

2018-11-08 Thread Titus Fortner
We've discussed this several times before, we are not going to make it the 
default for everyone. What we can do is make it easier for you to set it as 
a default for your project. That's on the list of things to work on.


On Thursday, November 8, 2018 at 12:07:10 AM UTC-6, rajagopalan madasami 
wrote:
>
> Hi Titus,
>
> I updated to WATIR 6.15 today. I tried using obsured? method here like
>
> require 'watir'
> b = Watir::Browser.new :firefox
> b.goto 'https://www.crmpro.com/index.html'
> b.wait_while{b.button(value: 'Login').obscured?}
> b.button(value: 'Login').click
>
> It works properly. But this functionality should be defaulted to all the 
> elements. Because In a bigger project, we don't know when element would be 
> obscured. eh? If I execute the below program with WATIR 6.15, it still throws 
> the elementClickInterceptedError.
>
> require 'watir'
>
> b = Watir::Browser.new :firefox
>
> b.goto 'https://www.crmpro.com/index.html'
>
> b.button(value: 'Login').click
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Same problem

2018-11-07 Thread Titus Fortner
I just released 6.15 because it's been waiting for three weeks for me to do 
that.

This fix will likely be in 6.16, whenever we get to releasing it. Any 
chance you can take a stab at updating the code and making a PR? 

Procedure for a PR is 
here: https://github.com/watir/watir#procedure-for-patchespull-requests
The method that needs updating is `Element#wait_for_exists`, and wait loop 
needs to call reset between calls for exist.

Let us know if you need help and we can assist.


On Tuesday, November 6, 2018 at 3:54:27 PM UTC-6, rajagopalan madasami 
wrote:
>
> Hi Titus, waiting for this fix. Thanks!
>
> On Wed 7 Nov, 2018, 2:29 AM  wrote:
>
>> Hi Titus,
>>
>> I face the same problem again in another place. I created a gist for 
>> this. Can you please confirm this whether it's a same issue and your fix 
>> would resolve this problem ?
>>
>> https://gist.github.com/Rajagopalan-M/47a9381bf82ca2468539a5bc1189ba40
>>
>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
I'm not sure what needs to happen after the click since that's where it is 
failing. But this code can't hurt because if there is no spinner it will 
move on to the next thing right away


On Tuesday, November 6, 2018 at 12:27:08 PM UTC-6, rajagopalan madasami 
wrote:
>
> Hi Titus,
>
> Can you please let me know whether my code is okay now?
>
>
> def waitAndClickButton(locator, action, name, data)
>   puts "ClickButton   : #{name}"
>   sleep 2
>   loc = getLocator(locator)
>   @b.div(id: "spinnerOverlay").wait_while(&:present?)
>   @b.button(loc.first => loc.last).click
>   @b.div(id: "spinnerOverlay").wait_while(&:present?)
> end
>
>
> On Tue, 6 Nov 2018 at 23:46, Titus Fortner  > wrote:
>
>> I posted it above:
>> @b.alert.ok 
>> @b.div(id: "spinnerOverlay").wait_while(&:present?) 
>> @b.button(id: "NavContinue").click 
>>
>> But we can make this better in the Watir code which is why I asked if you 
>> could also raise the issue on Github.
>>
>>
>>
>> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami 
>> wrote:
>>>
>>> Okay. Can you please tell me what order should I need to write the code? 
>>>
>>> And I have a question, If element goes stale then WATIR automatically 
>>> regains the element , right ? It regain in many places which I see.
>>>
>>> On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >>
>>>> It's failing because it goes stale. It goes stale because there is a 
>>>> refresh on the page, the refresh on the page happens after the spinner 
>>>> that 
>>>> the alert kicks off. The problem is that the element is located before the 
>>>> spinner, and for it to work right now, you have to wait until after the 
>>>> spinner to locate the element. However you organize it in the code, it 
>>>> needs to be in that order not the order you have.
>>>>
>>>>
>>>>
>>>> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami 
>>>> wrote:
>>>>>
>>>>> I am calling this function 
>>>>>
>>>>> def waitForPageLoad
>>>>>
>>>>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>>>>> (jQuery.active === 0)").eql? true}
>>>>> end
>>>>>
>>>>> function in every click function like
>>>>>
>>>>> def clickButton(locator, action, name, data)
>>>>>   puts "ClickButton   : #{name}"
>>>>>   loc = getLocator(locator)
>>>>>   @b.button(loc.first => loc.last).click
>>>>>   waitForPageLoad
>>>>> end
>>>>>
>>>>> Do you see the clickButton method 
>>>>>
>>>>> calls waitForPageLoad at the end so it waits for the spinner disappear. 
>>>>> So it doesn't click on the spinner. Even if it clicks at the 
>>>>>
>>>>> spinner it retry it because I have included 
>>>>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>>>>
>>>>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>>>>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>>>>   raise_present unless Wait.timer.remaining_time.positive?
>>>>>   raise_present unless %i[wait_for_present wait_for_enabled 
>>>>> wait_for_writable].include?(precondition)
>>>>>   retry
>>>>>
>>>>> So all I am seeing here is, It perfectlys lands on a page, and it 
>>>>> successfully enters into the click method but it waits for 30 seconds and 
>>>>> it fails. 
>>>>>
>>>>>   
>>>>>
>>>>>
>>>>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  
>>>>> wrote:
>>>>>
>>>>>> Yes, this makes sense from the code perspective.
>>>>>>
>>>>>> What your site is doing is requiring you to accept an alert, then it
>>>>>> does some kind of processing, then it refreshes some/all of the page.
>>>>>>
>>>>>> Your code is trying to click the element before the refresh has
>>>>>> happened, and because of the way you are rescuing it, it is giving you
>>>>>> misleading information. The element was

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
This is the alert click here:
https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de#file-gistfile1-txt-L2732


On Tuesday, November 6, 2018 at 12:20:07 PM UTC-6, rajagopalan madasami 
wrote:
>
> I am not clicking any alert before the button. And also Let me check your 
> solution first and if it works fine then I raise the defect. So now I need 
> to wait for spinner to disappear before and after the click. Okay.
>
> On Tue 6 Nov, 2018, 11:46 PM Titus Fortner   wrote:
>
>> I posted it above:
>> @b.alert.ok 
>> @b.div(id: "spinnerOverlay").wait_while(&:present?) 
>> @b.button(id: "NavContinue").click 
>>
>> But we can make this better in the Watir code which is why I asked if you 
>> could also raise the issue on Github.
>>
>>
>>
>> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami 
>> wrote:
>>>
>>> Okay. Can you please tell me what order should I need to write the code? 
>>>
>>> And I have a question, If element goes stale then WATIR automatically 
>>> regains the element , right ? It regain in many places which I see.
>>>
>>> On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >>
>>>> It's failing because it goes stale. It goes stale because there is a 
>>>> refresh on the page, the refresh on the page happens after the spinner 
>>>> that 
>>>> the alert kicks off. The problem is that the element is located before the 
>>>> spinner, and for it to work right now, you have to wait until after the 
>>>> spinner to locate the element. However you organize it in the code, it 
>>>> needs to be in that order not the order you have.
>>>>
>>>>
>>>>
>>>> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami 
>>>> wrote:
>>>>>
>>>>> I am calling this function 
>>>>>
>>>>> def waitForPageLoad
>>>>>
>>>>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>>>>> (jQuery.active === 0)").eql? true}
>>>>> end
>>>>>
>>>>> function in every click function like
>>>>>
>>>>> def clickButton(locator, action, name, data)
>>>>>   puts "ClickButton   : #{name}"
>>>>>   loc = getLocator(locator)
>>>>>   @b.button(loc.first => loc.last).click
>>>>>   waitForPageLoad
>>>>> end
>>>>>
>>>>> Do you see the clickButton method 
>>>>>
>>>>> calls waitForPageLoad at the end so it waits for the spinner disappear. 
>>>>> So it doesn't click on the spinner. Even if it clicks at the 
>>>>>
>>>>> spinner it retry it because I have included 
>>>>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>>>>
>>>>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>>>>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>>>>   raise_present unless Wait.timer.remaining_time.positive?
>>>>>   raise_present unless %i[wait_for_present wait_for_enabled 
>>>>> wait_for_writable].include?(precondition)
>>>>>   retry
>>>>>
>>>>> So all I am seeing here is, It perfectlys lands on a page, and it 
>>>>> successfully enters into the click method but it waits for 30 seconds and 
>>>>> it fails. 
>>>>>
>>>>>   
>>>>>
>>>>>
>>>>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  
>>>>> wrote:
>>>>>
>>>>>> Yes, this makes sense from the code perspective.
>>>>>>
>>>>>> What your site is doing is requiring you to accept an alert, then it
>>>>>> does some kind of processing, then it refreshes some/all of the page.
>>>>>>
>>>>>> Your code is trying to click the element before the refresh has
>>>>>> happened, and because of the way you are rescuing it, it is giving you
>>>>>> misleading information. The element was located but couldn't be used,
>>>>>> then at the point it is trying to be used it is stale, and that method
>>>>>> isn't relocating when stale.
>>>>>>
>>>>>> Can you raise an is

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
And, no it isn't automatically relooking up stale in the applicable method 
here, because this is not a use case we anticipated, but it is something we 
can fix.


On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami 
wrote:
>
> Okay. Can you please tell me what order should I need to write the code? 
>
> And I have a question, If element goes stale then WATIR automatically 
> regains the element , right ? It regain in many places which I see.
>
> On Tue 6 Nov, 2018, 11:39 PM Titus Fortner   wrote:
>
>> It's failing because it goes stale. It goes stale because there is a 
>> refresh on the page, the refresh on the page happens after the spinner that 
>> the alert kicks off. The problem is that the element is located before the 
>> spinner, and for it to work right now, you have to wait until after the 
>> spinner to locate the element. However you organize it in the code, it 
>> needs to be in that order not the order you have.
>>
>>
>>
>> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami 
>> wrote:
>>>
>>> I am calling this function 
>>>
>>> def waitForPageLoad
>>>
>>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>>> (jQuery.active === 0)").eql? true}
>>> end
>>>
>>> function in every click function like
>>>
>>> def clickButton(locator, action, name, data)
>>>   puts "ClickButton   : #{name}"
>>>   loc = getLocator(locator)
>>>   @b.button(loc.first => loc.last).click
>>>   waitForPageLoad
>>> end
>>>
>>> Do you see the clickButton method 
>>>
>>> calls waitForPageLoad at the end so it waits for the spinner disappear. So 
>>> it doesn't click on the spinner. Even if it clicks at the 
>>>
>>> spinner it retry it because I have included 
>>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>>
>>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>>   raise_present unless Wait.timer.remaining_time.positive?
>>>   raise_present unless %i[wait_for_present wait_for_enabled 
>>> wait_for_writable].include?(precondition)
>>>   retry
>>>
>>> So all I am seeing here is, It perfectlys lands on a page, and it 
>>> successfully enters into the click method but it waits for 30 seconds and 
>>> it fails. 
>>>
>>>   
>>>
>>>
>>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:
>>>
>>>> Yes, this makes sense from the code perspective.
>>>>
>>>> What your site is doing is requiring you to accept an alert, then it
>>>> does some kind of processing, then it refreshes some/all of the page.
>>>>
>>>> Your code is trying to click the element before the refresh has
>>>> happened, and because of the way you are rescuing it, it is giving you
>>>> misleading information. The element was located but couldn't be used,
>>>> then at the point it is trying to be used it is stale, and that method
>>>> isn't relocating when stale.
>>>>
>>>> Can you raise an issue on Github with this gist? Something like "Watir
>>>> should relocate stale elements when trying to click them"
>>>>
>>>> In the meantime, something like this should work:
>>>>
>>>> @b.alert.ok
>>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>>> @b.button(id: "NavContinue").click
>>>>
>>>>
>>>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>>>> >
>>>> > Hi Titus,
>>>> >
>>>> > Here is the gist url
>>>> >
>>>> > 
>>>> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>>> >
>>>> > --
>>>> > --
>>>> > Before posting, please read 
>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group
>>>> .
>>>> > In short: search before you ask, be nice.
>>>> >
>>>> > watir-...@googlegroups.com
>>>> > http://groups.google.com/group/watir-general
>>>> > watir-genera...@googlegroups.com
>>>> > ---
>>>> > You received this message because you are subscr

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
I posted it above:
@b.alert.ok 
@b.div(id: "spinnerOverlay").wait_while(&:present?) 
@b.button(id: "NavContinue").click 

But we can make this better in the Watir code which is why I asked if you 
could also raise the issue on Github.



On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami 
wrote:
>
> Okay. Can you please tell me what order should I need to write the code? 
>
> And I have a question, If element goes stale then WATIR automatically 
> regains the element , right ? It regain in many places which I see.
>
> On Tue 6 Nov, 2018, 11:39 PM Titus Fortner   wrote:
>
>> It's failing because it goes stale. It goes stale because there is a 
>> refresh on the page, the refresh on the page happens after the spinner that 
>> the alert kicks off. The problem is that the element is located before the 
>> spinner, and for it to work right now, you have to wait until after the 
>> spinner to locate the element. However you organize it in the code, it 
>> needs to be in that order not the order you have.
>>
>>
>>
>> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami 
>> wrote:
>>>
>>> I am calling this function 
>>>
>>> def waitForPageLoad
>>>
>>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>>> (jQuery.active === 0)").eql? true}
>>> end
>>>
>>> function in every click function like
>>>
>>> def clickButton(locator, action, name, data)
>>>   puts "ClickButton   : #{name}"
>>>   loc = getLocator(locator)
>>>   @b.button(loc.first => loc.last).click
>>>   waitForPageLoad
>>> end
>>>
>>> Do you see the clickButton method 
>>>
>>> calls waitForPageLoad at the end so it waits for the spinner disappear. So 
>>> it doesn't click on the spinner. Even if it clicks at the 
>>>
>>> spinner it retry it because I have included 
>>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>>
>>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>>   raise_present unless Wait.timer.remaining_time.positive?
>>>   raise_present unless %i[wait_for_present wait_for_enabled 
>>> wait_for_writable].include?(precondition)
>>>   retry
>>>
>>> So all I am seeing here is, It perfectlys lands on a page, and it 
>>> successfully enters into the click method but it waits for 30 seconds and 
>>> it fails. 
>>>
>>>   
>>>
>>>
>>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:
>>>
>>>> Yes, this makes sense from the code perspective.
>>>>
>>>> What your site is doing is requiring you to accept an alert, then it
>>>> does some kind of processing, then it refreshes some/all of the page.
>>>>
>>>> Your code is trying to click the element before the refresh has
>>>> happened, and because of the way you are rescuing it, it is giving you
>>>> misleading information. The element was located but couldn't be used,
>>>> then at the point it is trying to be used it is stale, and that method
>>>> isn't relocating when stale.
>>>>
>>>> Can you raise an issue on Github with this gist? Something like "Watir
>>>> should relocate stale elements when trying to click them"
>>>>
>>>> In the meantime, something like this should work:
>>>>
>>>> @b.alert.ok
>>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>>> @b.button(id: "NavContinue").click
>>>>
>>>>
>>>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>>>> >
>>>> > Hi Titus,
>>>> >
>>>> > Here is the gist url
>>>> >
>>>> > 
>>>> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>>> >
>>>> > --
>>>> > --
>>>> > Before posting, please read 
>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group
>>>> .
>>>> > In short: search before you ask, be nice.
>>>> >
>>>> > watir-...@googlegroups.com
>>>> > http://groups.google.com/group/watir-general
>>>> > watir-genera...@googlegroups.com
>

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
It's failing because it goes stale. It goes stale because there is a 
refresh on the page, the refresh on the page happens after the spinner that 
the alert kicks off. The problem is that the element is located before the 
spinner, and for it to work right now, you have to wait until after the 
spinner to locate the element. However you organize it in the code, it 
needs to be in that order not the order you have.



On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami 
wrote:
>
> I am calling this function 
>
> def waitForPageLoad
>
>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
> (jQuery.active === 0)").eql? true}
> end
>
> function in every click function like
>
> def clickButton(locator, action, name, data)
>   puts "ClickButton   : #{name}"
>   loc = getLocator(locator)
>   @b.button(loc.first => loc.last).click
>   waitForPageLoad
> end
>
> Do you see the clickButton method 
>
> calls waitForPageLoad at the end so it waits for the spinner disappear. So it 
> doesn't click on the spinner. Even if it clicks at the 
>
> spinner it retry it because I have included 
> Selenium::WebDriver::Error::ElementClickInterceptedError
>
> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>   raise_present unless Wait.timer.remaining_time.positive?
>   raise_present unless %i[wait_for_present wait_for_enabled 
> wait_for_writable].include?(precondition)
>   retry
>
> So all I am seeing here is, It perfectlys lands on a page, and it 
> successfully enters into the click method but it waits for 30 seconds and it 
> fails. 
>
>   
>
>
> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  > wrote:
>
>> Yes, this makes sense from the code perspective.
>>
>> What your site is doing is requiring you to accept an alert, then it
>> does some kind of processing, then it refreshes some/all of the page.
>>
>> Your code is trying to click the element before the refresh has
>> happened, and because of the way you are rescuing it, it is giving you
>> misleading information. The element was located but couldn't be used,
>> then at the point it is trying to be used it is stale, and that method
>> isn't relocating when stale.
>>
>> Can you raise an issue on Github with this gist? Something like "Watir
>> should relocate stale elements when trying to click them"
>>
>> In the meantime, something like this should work:
>>
>> @b.alert.ok
>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>> @b.button(id: "NavContinue").click
>>
>>
>> On Tue, Nov 6, 2018 at 10:56 AM > 
>> wrote:
>> >
>> > Hi Titus,
>> >
>> > Here is the gist url
>> >
>> > https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>> >
>> > --
>> > --
>> > Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group
>> .
>> > In short: search before you ask, be nice.
>> >
>> > watir-...@googlegroups.com 
>> > http://groups.google.com/group/watir-general
>> > watir-genera...@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-genera...@googlegroups.com .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
Yes, this makes sense from the code perspective.

What your site is doing is requiring you to accept an alert, then it
does some kind of processing, then it refreshes some/all of the page.

Your code is trying to click the element before the refresh has
happened, and because of the way you are rescuing it, it is giving you
misleading information. The element was located but couldn't be used,
then at the point it is trying to be used it is stale, and that method
isn't relocating when stale.

Can you raise an issue on Github with this gist? Something like "Watir
should relocate stale elements when trying to click them"

In the meantime, something like this should work:

@b.alert.ok
@b.div(id: "spinnerOverlay").wait_while(&:present?)
@b.button(id: "NavContinue").click


On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>
> Hi Titus,
>
> Here is the gist url
>
> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>
> --
> --
> Before posting, please read 
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
Can you paste the log into a gist or something so it is easier to read?


On Tuesday, November 6, 2018 at 10:20:26 AM UTC-6, rajagopalan madasami 
wrote:
>
> No, It throws this error unable to locate the element
>
>
> *Watir::Exception::UnknownObjectException: timed out after 60 seconds, 
> waiting for #"NavContinue", 
> :tag_name=>"button"}> to be located*
>
>   0) AGCSquoteCreation Test1
>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>  ?[31m?[0m
>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>  ?[31m  timed out after 60 seconds, waiting for # located: true; {:id=>"NavContinue", :tag_name=>"button"}> to be located?[0m
>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:30:in 
> `waitAndClickButton'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block in 
> execute'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in `each'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in 
> `execute'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in 
> `call'?[0m
>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in  (required)>'?[0m
>  ?[36m# --?[0m
>  ?[36m# --- Caused by: ---?[0m
>  ?[36m# Watir::Wait::TimeoutError:?[0m
>  ?[36m#   timed out after 60 seconds, waiting for true condition on 
> #"NavContinue", 
> :tag_name=>"button"}>?[0m
>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:30:in 
> `waitAndClickButton'?[0m
>
>
> On Tue, 6 Nov 2018 at 21:48, Titus Fortner  > wrote:
>
> This log is showing that the click was successful, but that the jquery 
> queue never empties. 
>
>
>
> On Tuesday, November 6, 2018 at 10:13:50 AM UTC-6, rajagopalan madasami 
> wrote:
>
> Hi Titus, 
>
> Here is the log 
>
> Testing started at 21:36 ... 
> C:\Ruby25\bin\ruby.exe C:\Ruby25\bin\rspec 
> C:/A/StringRay/Ruby_test_spec.rb 
> --require teamcity/spec/runner/formatter/teamcity/formatter --format 
> Spec::Runner::Formatter::TeamcityFormatter 
> C:/A/StringRay/InputFiles/Sanity1.xlsx 
> ["AGCSquoteCreation", "Test1", nil, nil] 
> nil 
> Test Starts in Latest Firefox 
> 2018-11-06 21:36:50 INFO Selenium -> POST 
> session/7e876088-d29b-4b08-90a2-6609870215df/url 
> 2018-11-06 21:36:50 INFO Selenium>>> 
> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/url | 
> {"url":"https://agcs-qa.maxprocessing.com/login.max?preprocess=true"} 
> 2018-11-06 21:37:44 INFO Selenium <- {"value":null} 
> Type  : User Name | testid 
> 2018-11-06 21:37:45 INFO Selenium -> POST 
> session/7e876088-d29b-4b08-90a2-6609870215df/element 
> 2018-11-06 21:37:45 INFO Selenium>>> 
> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/element 
> | {"using":"xpath","value":".//input[(not(@type) or 
> (translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"file\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"radio\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"checkbox\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"submit\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"reset\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"image\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"button\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"hidden\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"range\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"color\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"date\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"datetime-local\"))
>  
>
> and @nam

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
What JS library is your  Angular/React/JQuery?

On Tuesday, November 6, 2018 at 9:56:50 AM UTC-6, rajagopalan madasami 
wrote:
>
> Hi Titus,
>
> Here is I used waitAndclick method which uses b.element.click and then I 
> used waitAndClickButton method which uses b.button.click but both of them 
> are throwing the error. 
>
> def waitAndClickButton(locator, action, name, data)
>   puts "ClickButton   : #{name}"
>   sleep 2
>   loc = getLocator(locator)
>   @b.button(loc.first => loc.last).click
>   waitForPageLoad
> end
>
> def waitForPageLoad
>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
> (jQuery.active === 0)").eql? true}
> end
>
> You may ask why I put sleep 2, this is also another weird problem I am 
> facing, program click the button and program successfully
>
> moves to the next line but application is not replicating that, Application 
> is not receiving that click so it remains in the same page. 
>
> Do you have any idea how to resolve this without using wait?
>
>
> On Tue, 6 Nov 2018 at 21:17, Titus Fortner  > wrote:
>
>> That's weird because it is failing in the wait_for_exists method, but the 
>> error message calls the inspect method which shows that it has been 
>> located. Can you share your waitAndClick method? I'd like to figure out how 
>> to reproduce this.
>>
>> Is it possible for the element to have gone stale? That could account for 
>> this discrepancy.
>>
>> If you turn on Selenium logging it would be obvious if it were polling 
>> for `enabled` and getting exceptions. `Selenium::WebDriver.logger.level = 
>> :info`
>>
>>
>> On Tuesday, November 6, 2018 at 5:37:40 AM UTC-6, rajagopal...@gmail.com 
>> wrote:
>>>
>>> Hi Titus,
>>>
>>> I am facing weird problem,
>>>
>>> When I try to click the element, even after page arrives properly, it is 
>>> waiting for 60 seconds and not clicking the button sometimes, it throws 
>>> below error. but 4 out of 10 times it happens and rest of the time it runs 
>>> successfully. What might be the problem? I never faced such a problem so 
>>> far. 
>>>
>>>
>>> Watir::Exception::UnknownObjectException: timed out after 60 seconds, 
>>> waiting for #"NavContinue"}> to 
>>> be located
>>>
>>>   0) AGCSquoteCreation Test1
>>>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>>>  ?[31m?[0m
>>>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>>>  ?[31m  timed out after 60 seconds, waiting for 
>>> #"NavContinue"}> to be located?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in 
>>> `waitAndClick'?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block 
>>> in execute'?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in 
>>> `each'?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in 
>>> `execute'?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in 
>>> `call'?[0m
>>>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in >> (required)>'?[0m
>>>  ?[36m# --?[0m
>>>  ?[36m# --- Caused by: ---?[0m
>>>  ?[36m# Watir::Wait::TimeoutError:?[0m
>>>  ?[36m#   timed out after 60 seconds, waiting for true condition on 
>>> #"NavContinue"}>?[0m
>>>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:15:in 
>>> `waitAndClick'?[0m
>>>
>>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
I will need to see logging information to be able to help further.



On Tuesday, November 6, 2018 at 9:49:32 AM UTC-6, rajagopal...@gmail.com 
wrote:
>
> Hi Titus,
>
> something goes terribly wrong while watir waits for element to exist. Even 
> after page loads completely, button clicks waits for 30 seconds and reports 
> me element doesn't exist. So I did this.
>
> begin
> b.button(id: 'something').click
> rescue
> b.button(id: 'something').click
> end
>
>
> I put a debug pointer at the button click which comes in rescue so when 
> program enters into the rescue block, I execute by clicking F8 in RubyMine, 
> it works fine. So something terribly goes wrong in your waiting for element 
> to exist. 
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
That's weird because it is failing in the wait_for_exists method, but the 
error message calls the inspect method which shows that it has been 
located. Can you share your waitAndClick method? I'd like to figure out how 
to reproduce this.

Is it possible for the element to have gone stale? That could account for 
this discrepancy.

If you turn on Selenium logging it would be obvious if it were polling for 
`enabled` and getting exceptions. `Selenium::WebDriver.logger.level = :info`


On Tuesday, November 6, 2018 at 5:37:40 AM UTC-6, rajagopal...@gmail.com 
wrote:
>
> Hi Titus,
>
> I am facing weird problem,
>
> When I try to click the element, even after page arrives properly, it is 
> waiting for 60 seconds and not clicking the button sometimes, it throws 
> below error. but 4 out of 10 times it happens and rest of the time it runs 
> successfully. What might be the problem? I never faced such a problem so 
> far. 
>
>
> Watir::Exception::UnknownObjectException: timed out after 60 seconds, 
> waiting for #"NavContinue"}> to 
> be located
>
>   0) AGCSquoteCreation Test1
>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>  ?[31m?[0m
>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>  ?[31m  timed out after 60 seconds, waiting for # located: true; {:id=>"NavContinue"}> to be located?[0m
>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in 
> `waitAndClick'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block in 
> execute'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in `each'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in 
> `execute'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in 
> `call'?[0m
>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in  (required)>'?[0m
>  ?[36m# --?[0m
>  ?[36m# --- Caused by: ---?[0m
>  ?[36m# Watir::Wait::TimeoutError:?[0m
>  ?[36m#   timed out after 60 seconds, waiting for true condition on 
> #"NavContinue"}>?[0m
>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:15:in 
> `waitAndClick'?[0m
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Hiddenfield, Is there a limitation in PageObject

2018-10-25 Thread Titus Fortner
Find method returns a PO element,
You are calling puts on that, so the result makes sense.

If you move your puts into the block it will print the value you are
looking for.



On Thu, Oct 25, 2018, 4:56 AM NaviHan  wrote:

> Found this really confusing behavior while dealing with this element.
> Basically I want to get the value
>
> 
>
>
>
> I have declared the pageobect as below
>
> hidden_fields(:test, :name => 'pid')
>
>
> And trying to print the value actually prints the pageobject instead of
> the value.
>
> puts test_elements.find {|el| el.value}
>
> #
>
>
> So I did a "value.value" and Watir complained as
> NoMethodError: undefined method `value' for "9351785586540":String
>
> Any clue why this strange behavior. Is this a limitation of PageObject?
>
>
> --
> --
> Before posting, please read
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Problem with Button()

2018-10-24 Thread Titus Fortner
Periodically RubyMine will use the wrong method to do its analysis. There must 
be another button method somewhere in your required files that doesn't take any 
parameters. No idea why it's only happening intermittently. If the code is 
working, you sometimes just have to ignore RubyMine's help. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Problem with Button()

2018-10-24 Thread Titus Fortner
If you click on the line you should see a small red light bulb pop up on the 
left that you can click to find out what RubyMine doesn't like. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] How do i copy employee dataset into a textbox accurately?

2018-10-14 Thread Titus Fortner
It's hard to know how to help without more information about what
"erratic behavior" is.

If it's a lot of text, you might try using `#set!` instead of `#set`.
it uses javascript instead of Selenium, and it verifies that the value
of the field matches what you passed into it.

On Sun, Oct 14, 2018 at 7:56 PM Sharat Oommen  wrote:
>
> Hi all,
> I have been facing this issue with watir where i havent been able to copy a 
> particular dataset into a text box effectively. Usually most websites support 
> excel sheet upload but in this particular case i have to copy paste the data 
> set into a textbox directly. It works fine when i manually do it however 
> while trying to automate it with watir i am finding eratic behaviour/ i tried 
> to use a combination of /t and /n in the string set passed to the textox but 
> it still doesnt help. Any help wrt this regard would be much appreciated.
>
> Thanks
>
> --
> --
> Before posting, please read 
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] has anyone experience with executing javascript and extracting datalayer?

2018-10-04 Thread Titus Fortner
Hmm I can't duplicate this, but... If you do not want returning elements
from a JavaScript call to be automatically translated into Watir elements,
you can do:

b.wd.execute_script


On Thu, Oct 4, 2018, 2:26 AM Sam Nissen  wrote:

> Hi Titus, I can replicate this:
>
> # Set your browser language to en-uk
> b = Watir::Browser.new :chrome
> b.goto "https://rakutenmarketing.com/en-uk/";
> b.span(text: /LEARN MORE/i).click
> b.execute_script("return dataLayer;")
> Selenium::WebDriver::Error::StaleElementReferenceError: stale element
> reference: element is not attached to the page document
>   (Session info: chrome=69.0.3497.100)
>   (Driver info: chromedriver=2.35.528157 (
> 4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.13.6 x86_64
> )
> from /path/.rvm/gems/ruby-2.4.1/gems/selenium-webdriver-3.14.0/lib/
> selenium/webdriver/remote/bridge.rb:164:in `execute'
> from
> /path/.rvm/gems/ruby-2.4.1/gems/selenium-webdriver-3.14.0/lib/selenium/webdriver/remote/oss/bridge.rb:584:in
> `execute'
> from
> /path/.rvm/gems/ruby-2.4.1/gems/selenium-webdriver-3.14.0/lib/selenium/webdriver/remote/oss/bridge.rb:477:in
> `element_tag_name'
> from /path/.rvm/gems/ruby-2.4.1/gems/selenium-webdriver-3.14.0/lib/
> selenium/webdriver/common/element.rb:86:in `tag_name'
> from
> /path/.rvm/gems/ruby-2.4.1/gems/watir-6.14.0/lib/watir/browser.rb:324:in `
> wrap_element'
> from
> /path/.rvm/gems/ruby-2.4.1/gems/watir-6.14.0/lib/watir/browser.rb:311:in
> `wrap_elements_in'
> from /path/.rvm/gems/ruby-2.4.1/gems/watir-6.14.0/lib/watir/browser.rb:315
> :in `block in wrap_elements_in'
> from
> /path/.rvm/gems/ruby-2.4.1/gems/watir-6.14.0/lib/watir/browser.rb:315:in `
> each'
> from
> /path/.rvm/gems/ruby-2.4.1/gems/watir-6.14.0/lib/watir/browser.rb:315:in
> `wrap_elements_in'
> from /path/.rvm/gems/ruby-2.4.1/gems/watir-6.14.0/lib/watir/browser.rb:313
> :in `block in wrap_elements_in'
> from
> /path/.rvm/gems/ruby-2.4.1/gems/watir-6.14.0/lib/watir/browser.rb:313:in `
> map'
> from
> /path/.rvm/gems/ruby-2.4.1/gems/watir-6.14.0/lib/watir/browser.rb:313:in
> `wrap_elements_in'
> from /path/.rvm/gems/ruby-2.4.1/gems/watir-6.14.0/lib/watir/browser.rb:217
> :in `execute_script'
> from (irb):29
> from /path/.rvm/rubies/ruby-2.4.1/bin/irb:11:in `'
>
>
>
> On Thursday, October 4, 2018 at 8:33:01 AM UTC+1, gary wrote:
>>
>> stale element reference: element is not attached to the page document
>>   (Session info: chrome=69.0.3497.100)
>>   (Driver info: chromedriver=2.37.544315
>> (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Windows NT 10.0.17134
>> x86_64)
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/response.rb:69:in
>> `assert_ok'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/response.rb:32:in
>> `initialize'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/http/common.rb:81:in
>> `new'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/http/common.rb:81:in
>> `create_response'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/http/default.rb:86:in
>> `request'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/http/common.rb:59:in
>> `call'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/bridge.rb:653:in
>> `raw_execute'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/bridge.rb:631:in
>> `execute'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/remote/bridge.rb:537:in
>> `element_tag_name'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.1/lib/selenium/webdriver/common/element.rb:88:in
>> `tag_name'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:343:in
>> `wrap_element'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:330:in
>> `wrap_elements_in'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:334:in
>> `block in wrap_elements_in'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:334:in
>> `each'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.0.2/lib/watir/browser.rb:334:in
>> `wrap_elements_in'
>> C:/Ruby23-x64/lib/ruby/gems/2.3.0/g

Re: [wtr-general] has anyone experience with executing javascript and extracting datalayer?

2018-10-03 Thread Titus Fortner
Hmm, it should be really difficult to get that exception in watir. Can you
provide a stack trace?


On Wed, Oct 3, 2018, 3:41 AM 'gary' via Watir General <
watir-general@googlegroups.com> wrote:

> hi,
>
> I'm having trouble converting some selenium scripts to watir, lol please
> don't ask me why, anyway, the basic selenium script below works a treat:
>
> require 'selenium-webdriver'
> $b=Selenium::WebDriver.for :chrome
> $b.get'mywebsite'
> # click cookie message overlay
> sleep(3)
> $b.find_element(:xpath=>"//*[@id='continue']").click
> puts $b.execute_script("return dataLayer;")
>
>
> the watir equivalent appears to fail:
>
> require 'watir'
> $b = Watir::Browser.new :chrome
> $b.goto('mywebsite')
> # click cookie message overlay
> sleep(3)
> $b.link(id: 'continue').click
> puts $b.execute_script("return dataLayer;")
>
> returning the following error:
>
>  stale element reference: element is not attached to the page document
> (Selenium::WebDriver::Error::StaleElementReferenceError)
>
>
> does anyone know of a workaround for this or any ideas as to how to
> extract the relevant data?
>
> Regards,
>
> G
>
> --
> --
> Before posting, please read
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Link Locator

2018-09-28 Thread Titus Fortner
I can't remember, why do you have to use visible_text instead of text? The 
vast majority of the time text should be both sufficient and performant.

That being said, I'm currently working to improve text location performance 
across the board.


On Friday, September 28, 2018 at 7:59:00 AM UTC-7, rajagopal...@gmail.com 
wrote:
>
>  Hi Titus,
>
> You asked me to use visible_text in the place of link locator, actually it 
> works fine but when you go deeper to search more and more link using this 
> visible_text: it takes so much time even though it's wrapped up with 
> customized method like link(), so please don't remove link: locator, may be 
> you can give info about visible_text but don't remove it. Link: locator 
> works like a charm. 
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Titus Fortner
Also, Watir has a `Element#height` method, so you shouldn't need to resort 
to JS to get that value.



On Tuesday, September 25, 2018 at 11:31:32 AM UTC-7, Titus Fortner wrote:
>
> Yeah, it's clicking, but I suspect JS event isn't ready to act yet. 
>
> Note the style transition attributes there. Try waiting for the element 
> style to not include "overflow" after the element becomes present. You can 
> also try waiting for the size of the slide dialog container to equal some 
> value, but that's more hacky. :)
>
>
>
> On Tuesday, September 25, 2018 at 9:04:27 AM UTC-7, NaviHan wrote:
>>
>> Hi Titus & Justin
>>
>> My theory of actually clicking the button before the pop is fully loaded 
>> could be wrong, because even if its not fully loaded the click on "continue 
>> as guest" should dismiss the popup.
>>
>> Please see the video here 
>>
>>
>> https://drive.google.com/file/d/1ycWdST29FptgOS5GYDfRuAPUVBfeQt3h/view?usp=sharing
>>
>> But what made me think that the button is actually clicked is the 
>> screenshot taken at the point of failure, which has a highlighter around 
>> the "continue as guest" button which indicated the button is clicked.
>>
>> https://i.imgur.com/TdhYPz4.png
>>
>> Both are contradictory.
>>
>> What do you think?
>>
>>
>> On Tuesday, 25 September 2018 14:41:15 UTC+10, NaviHan wrote:
>>>
>>> Its been some days I found this issue untill I understood today the 
>>> cause of failure.
>>>
>>> The behavior is
>>> a. The user enters the email on check out page
>>> b. A pop up skids in from the top of the page
>>> c. The user clicks a "continue as guest "button on the pop up
>>> d. The pop up skids back in and disappears
>>> e. Verify the pop up disappeared
>>>
>>> The issue is between step b and step c there is a time when the pop up 
>>> is sliding into the page until its loaded completely. During this time the 
>>> script clicks the dismiss button. Because the pop hasent completed loading 
>>> the click doesn't make it disappear.
>>>
>>> Similarly becasue the pop up takes time to slide back and disapper the 
>>> check at step e fails.
>>>
>>> For the time being Im working around this issue with sleeps. But is 
>>> there a neater way?
>>>
>>>
>>> The pop up is defined as 
>>>
>>> button(:continue_as_guest, :class => ['button', 'close-dialog-button'])
>>>
>>>
>>> The code that does the job is 
>>>
>>> def continue_as_guest
>>>   continue_as_guest_element.wait_until(&:present?).click
>>> end
>>>
>>>
>>> After sleep, which works fine
>>>
>>> def continue_as_guest
>>>   sleep 5
>>>   continue_as_guest_element.wait_until(&:present?).click
>>>   sleep 5
>>> end
>>>
>>>
>>> Note:- I have also tried to wait_while(&:present?) still the issue stays 
>>> the same
>>>
>>> def continue_as_guest
>>>   
>>> continue_as_guest_element.wait_until(&:present?).tap(&:click).wait_while(&:present?)
>>> end
>>>
>>>
>>>
>>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Titus Fortner
Yeah, it's clicking, but I suspect JS event isn't ready to act yet. 

Note the style transition attributes there. Try waiting for the element 
style to not include "overflow" after the element becomes present. You can 
also try waiting for the size of the slide dialog container to equal some 
value, but that's more hacky. :)



On Tuesday, September 25, 2018 at 9:04:27 AM UTC-7, NaviHan wrote:
>
> Hi Titus & Justin
>
> My theory of actually clicking the button before the pop is fully loaded 
> could be wrong, because even if its not fully loaded the click on "continue 
> as guest" should dismiss the popup.
>
> Please see the video here 
>
>
> https://drive.google.com/file/d/1ycWdST29FptgOS5GYDfRuAPUVBfeQt3h/view?usp=sharing
>
> But what made me think that the button is actually clicked is the 
> screenshot taken at the point of failure, which has a highlighter around 
> the "continue as guest" button which indicated the button is clicked.
>
> https://i.imgur.com/TdhYPz4.png
>
> Both are contradictory.
>
> What do you think?
>
>
> On Tuesday, 25 September 2018 14:41:15 UTC+10, NaviHan wrote:
>>
>> Its been some days I found this issue untill I understood today the cause 
>> of failure.
>>
>> The behavior is
>> a. The user enters the email on check out page
>> b. A pop up skids in from the top of the page
>> c. The user clicks a "continue as guest "button on the pop up
>> d. The pop up skids back in and disappears
>> e. Verify the pop up disappeared
>>
>> The issue is between step b and step c there is a time when the pop up is 
>> sliding into the page until its loaded completely. During this time the 
>> script clicks the dismiss button. Because the pop hasent completed loading 
>> the click doesn't make it disappear.
>>
>> Similarly becasue the pop up takes time to slide back and disapper the 
>> check at step e fails.
>>
>> For the time being Im working around this issue with sleeps. But is there 
>> a neater way?
>>
>>
>> The pop up is defined as 
>>
>> button(:continue_as_guest, :class => ['button', 'close-dialog-button'])
>>
>>
>> The code that does the job is 
>>
>> def continue_as_guest
>>   continue_as_guest_element.wait_until(&:present?).click
>> end
>>
>>
>> After sleep, which works fine
>>
>> def continue_as_guest
>>   sleep 5
>>   continue_as_guest_element.wait_until(&:present?).click
>>   sleep 5
>> end
>>
>>
>> Note:- I have also tried to wait_while(&:present?) still the issue stays 
>> the same
>>
>> def continue_as_guest
>>   
>> continue_as_guest_element.wait_until(&:present?).tap(&:click).wait_while(&:present?)
>> end
>>
>>
>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Titus Fortner
> 3. The click is sent to the coordinates, which since the button has since 
moved, will not click the button

If this happened, there should be a stale element exception, which Watir 
would continue to relocate until it worked, which is why I suspect it is JS 
element/action binding related, which means the fire event theoretically 
wouldn't do anything differently.

Dynamically waiting for an element to stop moving is kind of cool... Hadn't 
considered that approach before.



On Tuesday, September 25, 2018 at 8:37:53 AM UTC-7, Justin Ko wrote:
>
> (Sorry, if some of this repeats Titus's response. I was half way through 
> this when he replied.)
>
> If I'm envisioning the sliding correctly, I believe what happens is:
> 1. The button starts sliding on to the page (at which point it'll be 
> considered present)
> 2. The coordinates of the button are retrieved, however this will be some 
> point along the slide path (rather than the final destination)
> 3. The click is sent to the coordinates, which since the button has since 
> moved, will not click the button
> 4. The button reaches it's final destination
>
> Ideally, you would find something that indicates that the animation has 
> completed. I was recently told that jQuery has some property to check for 
> its animations. You could see if there is something similar in your 
> application. Waiting on this would likely be the most robust approach.
>
> The quickest solution, would be to directly fire the click event, without 
> worrying about click coordinates. This would make the script less like a 
> user, but might be acceptable.
>
> def continue_as_guest
>   continue_as_guest_element.fire_event(:onclick)
> end
>
> If you want to maintain the more user-like behaviour, you could wait for 
> the button to reach it's final destination before doing the click. If final 
> destination is known, you could do:
>
> def continue_as_guest
>   btn = continue_as_guest_element
>   btn.wait_until do |btn|
>   center = btn.center
>   center.x == 464 && center.y == 173 # using your expected coordinates
>   end
>   btn.click
> end
>
> If you don't know the exact destination, you could do some polling:
>
> def continue_as_guest
>   btn = continue_as_guest_element
>   initial_center = btn.center
>   btn.wait_until do |btn|
>   sleep(1) # assuming the animation moves fast enough
>   new_center = btn.center
>   initial_center.x == new_center.x && new_center.y == new_center.y
>   end
>   btn.click
> end
>
> Justin
>
> On Tuesday, September 25, 2018 at 11:30:48 AM UTC-4, Titus Fortner wrote:
>>
>> This kind of dynamic code is difficult.
>>
>> Firstly, `wait_until(&:present?).click` is currently redundant. The wait 
>> will happen automatically if you just do: `click` 
>>
>> Essentially the driver is processing the element as displayed before the 
>> desired action is attached to that element.  Ideally, the front end devs 
>> add classes that indicate the status of the transitions that can be polled 
>> specifically before acting.
>>
>> If this is being done through a specific JS framework (like jQuery or 
>> Angular), you can do a generic wait for that framework's activity to be 
>> complete (see watir_angular gem or PageObject's JavascriptFrameworkFacade 
>> for JQuery)
>>
>> The final and hackiest approach I have used in the past is to implement 
>> an `#ensure_click` method where you specify the condition that has to be 
>> met for the click to be successful, and re-click if it is not. But this is 
>> inherently tricky because of all the race conditions possible.
>>
>>
>>
>> On Monday, September 24, 2018 at 9:41:15 PM UTC-7, NaviHan wrote:
>>>
>>> Its been some days I found this issue untill I understood today the 
>>> cause of failure.
>>>
>>> The behavior is
>>> a. The user enters the email on check out page
>>> b. A pop up skids in from the top of the page
>>> c. The user clicks a "continue as guest "button on the pop up
>>> d. The pop up skids back in and disappears
>>> e. Verify the pop up disappeared
>>>
>>> The issue is between step b and step c there is a time when the pop up 
>>> is sliding into the page until its loaded completely. During this time the 
>>> script clicks the dismiss button. Because the pop hasent completed loading 
>>> the click doesn't make it disappear.
>>>
>>> Similarly becasue the pop up takes time to slide back and disapper the 
>>> check at step e fails.
>>&g

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Titus Fortner
This kind of dynamic code is difficult.

Firstly, `wait_until(&:present?).click` is currently redundant. The wait 
will happen automatically if you just do: `click` 

Essentially the driver is processing the element as displayed before the 
desired action is attached to that element.  Ideally, the front end devs 
add classes that indicate the status of the transitions that can be polled 
specifically before acting.

If this is being done through a specific JS framework (like jQuery or 
Angular), you can do a generic wait for that framework's activity to be 
complete (see watir_angular gem or PageObject's JavascriptFrameworkFacade 
for JQuery)

The final and hackiest approach I have used in the past is to implement an 
`#ensure_click` method where you specify the condition that has to be met 
for the click to be successful, and re-click if it is not. But this is 
inherently tricky because of all the race conditions possible.



On Monday, September 24, 2018 at 9:41:15 PM UTC-7, NaviHan wrote:
>
> Its been some days I found this issue untill I understood today the cause 
> of failure.
>
> The behavior is
> a. The user enters the email on check out page
> b. A pop up skids in from the top of the page
> c. The user clicks a "continue as guest "button on the pop up
> d. The pop up skids back in and disappears
> e. Verify the pop up disappeared
>
> The issue is between step b and step c there is a time when the pop up is 
> sliding into the page until its loaded completely. During this time the 
> script clicks the dismiss button. Because the pop hasent completed loading 
> the click doesn't make it disappear.
>
> Similarly becasue the pop up takes time to slide back and disapper the 
> check at step e fails.
>
> For the time being Im working around this issue with sleeps. But is there 
> a neater way?
>
>
> The pop up is defined as 
>
> button(:continue_as_guest, :class => ['button', 'close-dialog-button'])
>
>
> The code that does the job is 
>
> def continue_as_guest
>   continue_as_guest_element.wait_until(&:present?).click
> end
>
>
> After sleep, which works fine
>
> def continue_as_guest
>   sleep 5
>   continue_as_guest_element.wait_until(&:present?).click
>   sleep 5
> end
>
>
> Note:- I have also tried to wait_while(&:present?) still the issue stays 
> the same
>
> def continue_as_guest
>   
> continue_as_guest_element.wait_until(&:present?).tap(&:click).wait_while(&:present?)
> end
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-20 Thread Titus Fortner
Hey Sam. Is now a good time to release the update and publish a blog post 
about it? :)


On Thursday, September 20, 2018 at 8:20:16 AM UTC-7, Sam Nissen wrote:
>
> Hi Navi -- I created that gem, help maintain it, and would be happy to 
> help you if you run across any issues.
>
> On Thursday, September 20, 2018 at 2:33:00 PM UTC+1, NaviHan wrote:
>>
>> Thanks Justin, Let me give it a go..
>>
>> On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote:
>>>
>>> Hi 
>>>
>>> I have put this code in the hooks which takes scresnshot when a test 
>>> fails. The issue is that Im not getting the full browser screen. Its chops 
>>> off at the bottom
>>>
>>> After do |scenario|
>>>  take_screenshot(@browser, scenario)
>>> end
>>>
>>>
>>> def take_screenshot(browser, scenario)
>>>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>>>   if scenario.failed?
>>> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
>>> screenshot_path =  "#{scenario_name}" + "_failure_" + time
>>> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>>>   end
>>> end
>>>
>>>
>>> By the way my before hooks looks like this.
>>>
>>> Before do|scenario|
>>> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
>>> @browser.goto "https://www.sandbox.paypal.com";
>>> @browser.cookies.clear
>>> @browser.goto "https://portal-sandbox.afterpay.com";
>>> @browser.cookies.clear
>>> @browser.goto "https://i-pay.co.za";
>>> @browser.cookies.clear
>>> @browser.goto("ci.XXX.com/")
>>> @browser.window.maximize
>>> @browser.driver.manage.timeouts.implicit_wait = 0
>>> @browser.cookies.clear
>>> @browser.driver.manage.window.maximize
>>> PageObject.default_element_wait=(10)
>>> PageObject.javascript_framework = :jquery
>>> end #before scenario
>>>
>>>
>>>
>>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Maybe look in an iframe? error when clicking button

2018-09-20 Thread Titus Fortner
Ah, yes, it's a Ruby object method and has nothing to do with tapping a 
screen or the like:
https://ruby-doc.org/core-2.5.1/Object.html#method-i-tap

foo.click
==> nil

foo.tap(&:click}
==> foo

For example:

def foo
  result = do_something
  puts "We did something"
  result
end

can be written on one line:

def foo
  do_something.tap { puts "We did something" }
end


On Thursday, September 20, 2018 at 7:47:35 AM UTC-7, NaviHan wrote:
>
> Ok, Titus, but why use click on self?
> Just searched the web for documentation on tap, couldnt find it.
>
> Could you please point me to if any?
>
> On Thursday, 20 September 2018 20:50:21 UTC+10, NaviHan wrote:
>>
>> I have a bag page where I have applied two coupons. Once the coupons are 
>> applied the source looks like this
>> 
>>
>>
>> Applied codes:
>>
>> 
>> 
>> 
>> 9840150120702065
>> 
>> 
>> 
>> > "delete-coupon">
>> 
>> Remove
>> 
>> 
>> 
>>
>>
>> 
>> 
>> 
>> autotest_order
>> 
>> 
>> 
>> > "delete-coupon">
>> 
>> Remove
>> 
>> 
>> 
>>
>> 
>>
>>
>>
>> There is a remove link(button) against each coupon. Basically my test 
>> clicks these buttons to remove them
>>
>> I have the page object defined as and the step def and method as follows
>>
>> buttons(:delete_coupon, :id => 'delete-coupon')
>>
>>
>>
>>
>> And(/^the customer removes the coupons\/vouchers from Bag Page$/) do |
>> table|
>>   on(MybagPage) do |page|
>> @remove_voucher_list = table.hashes
>> @remove_voucher_list.each {|data|
>>   page.remove_voucher_from_bag data['voucher_id']
>> }
>>   end
>>
>>
>> def remove_voucher_from_bag coupon_id
>>   delete_coupon_elements.find{|el| el.value.to_s == coupon_id.to_s}.click
>> end
>>
>>
>> The script removes the coupon "9840150120702065", but when trying to 
>> remove the next coupon fails with folowing message
>> Watir::Exception::UnknownObjectException: timed out after 30 seconds, 
>> waiting for #"delete-coupon", 
>> :tag_name=>"button", :index=>1}> to be located; Maybe look in an iframe?
>> ./features/support/pages/Frontend/Cotton_On/Mybag_Page.rb:141:in `block 
>> in remove_voucher_from_bag'
>>
>>
>>
>> Any clue whats missing here?
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Maybe look in an iframe? error when clicking button

2018-09-20 Thread Titus Fortner
The tap methods returns self after doing whatever is in the block. It lets you 
chain methods more easily. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread Titus Fortner
yes
On Thu, Sep 13, 2018 at 8:41 PM rajagopalan madasami
 wrote:
>
> Waiting for select list is added?
>
> On Fri 14 Sep, 2018, 7:18 AM Titus Fortner,  wrote:
>>
>> 6.14 was just released, hopefully it addresses your issues.
>> On Thu, Sep 13, 2018 at 9:57 AM rajagopalan madasami
>>  wrote:
>> >
>> > Yes, I saw this new change in your new article but I can't use WATIR 6.13 
>> > because as you know, its not waiting for select list.
>> >
>> > On Thu 13 Sep, 2018, 9:00 PM Titus Fortner,  wrote:
>> >>
>> >> As of 6.13 you can now that wait like this:
>> >>
>> >> b.label(id: 'something').wait_until(text: 'Expected Text')
>> >>
>> >>
>> >> On Thursday, September 13, 2018 at 4:40:53 AM UTC-7, rajagopalan madasami 
>> >> wrote:
>> >>>
>> >>> Hi Navi,
>> >>>
>> >>> yes, you are right with your understanding.
>> >>>
>> >>> WATIR locates elements completely different from Selenium
>> >>>
>> >>> When you write,
>> >>>
>> >>> element=b.span(id: 'click')
>> >>>
>> >>> It doesn't locate the element, but when you write
>> >>>
>> >>> element.click
>> >>>
>> >>> it locates the element and continue to perform the click operation, this 
>> >>> arrangement is useful to relocate the element when element goes to 
>> >>> stale, waiting until element is visible and likewise this arrangement is 
>> >>> useful for cases. Technically this should include even when I call text 
>> >>> method as well. But I do in my project here is,
>> >>>
>> >>> I write code like
>> >>>
>> >>> b.wait_until(b.label(id: 'something').text?'Expected Text')
>> >>>
>> >>> This will reexecute the statement for 30 seconds, otherwise it would 
>> >>> throw the error
>> >>>
>> >>> Or
>> >>>
>> >>> b.label(id: 'something').wait_until{|element| element.text.eql?'Expected 
>> >>> Text'}
>> >>>
>> >>>
>> >>>
>> >>> On Thu, Sep 13, 2018 at 11:16 AM NaviHan  wrote:
>> >>>>
>> >>>> Hi Titus
>> >>>>
>> >>>> Thats makes it very clear now :-)
>> >>>>
>> >>>> Just to confirm, action methods as in set, click, select
>> >>>> And the reading attribute values like id, text, or any other custom 
>> >>>> attribute are not auto covered and we need to use wait_until(&:present?)
>> >>>>
>> >>>> Is that correct?
>> >>>>
>> >>>> Cheers
>> >>>> Navi
>> >>>>
>> >>>> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>> >>>>>
>> >>>>> This is something that keeps me a bit sceptic when I write and read 
>> >>>>> the automation code in my project.
>> >>>>> This used PageObjects.
>> >>>>>
>> >>>>> I have seen extensive use of element referces, for example
>> >>>>>
>> >>>>> button(:add_to_bag, :css => '#add-to-cart')
>> >>>>> add_to_bag.element.when_present.click
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> instead of
>> >>>>>
>> >>>>> add_to_bag
>> >>>>>
>> >>>>> which directly clicks the element
>> >>>>>
>> >>>>> I have also seen extensive use of referencing elements using 
>> >>>>> .when_present, .wait_until_present etc
>> >>>>>
>> >>>>> Im confused where we should draw the line when deciding to reference 
>> >>>>> the element and actually using it(as in directly calling "add_o_bag" 
>> >>>>> in the above example to click the element.
>> >>>>>
>> >>>>> Any thoughts?
>> >>>>>
>> >>>>>
>> >>>> --
>> >>>> --
>> >>>> Before posting, please read 
>> >>>> https://gi

Re: [wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread Titus Fortner
6.14 was just released, hopefully it addresses your issues.
On Thu, Sep 13, 2018 at 9:57 AM rajagopalan madasami
 wrote:
>
> Yes, I saw this new change in your new article but I can't use WATIR 6.13 
> because as you know, its not waiting for select list.
>
> On Thu 13 Sep, 2018, 9:00 PM Titus Fortner,  wrote:
>>
>> As of 6.13 you can now that wait like this:
>>
>> b.label(id: 'something').wait_until(text: 'Expected Text')
>>
>>
>> On Thursday, September 13, 2018 at 4:40:53 AM UTC-7, rajagopalan madasami 
>> wrote:
>>>
>>> Hi Navi,
>>>
>>> yes, you are right with your understanding.
>>>
>>> WATIR locates elements completely different from Selenium
>>>
>>> When you write,
>>>
>>> element=b.span(id: 'click')
>>>
>>> It doesn't locate the element, but when you write
>>>
>>> element.click
>>>
>>> it locates the element and continue to perform the click operation, this 
>>> arrangement is useful to relocate the element when element goes to stale, 
>>> waiting until element is visible and likewise this arrangement is useful 
>>> for cases. Technically this should include even when I call text method as 
>>> well. But I do in my project here is,
>>>
>>> I write code like
>>>
>>> b.wait_until(b.label(id: 'something').text?'Expected Text')
>>>
>>> This will reexecute the statement for 30 seconds, otherwise it would throw 
>>> the error
>>>
>>> Or
>>>
>>> b.label(id: 'something').wait_until{|element| element.text.eql?'Expected 
>>> Text'}
>>>
>>>
>>>
>>> On Thu, Sep 13, 2018 at 11:16 AM NaviHan  wrote:
>>>>
>>>> Hi Titus
>>>>
>>>> Thats makes it very clear now :-)
>>>>
>>>> Just to confirm, action methods as in set, click, select
>>>> And the reading attribute values like id, text, or any other custom 
>>>> attribute are not auto covered and we need to use wait_until(&:present?)
>>>>
>>>> Is that correct?
>>>>
>>>> Cheers
>>>> Navi
>>>>
>>>> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>>>>>
>>>>> This is something that keeps me a bit sceptic when I write and read the 
>>>>> automation code in my project.
>>>>> This used PageObjects.
>>>>>
>>>>> I have seen extensive use of element referces, for example
>>>>>
>>>>> button(:add_to_bag, :css => '#add-to-cart')
>>>>> add_to_bag.element.when_present.click
>>>>>
>>>>>
>>>>>
>>>>> instead of
>>>>>
>>>>> add_to_bag
>>>>>
>>>>> which directly clicks the element
>>>>>
>>>>> I have also seen extensive use of referencing elements using 
>>>>> .when_present, .wait_until_present etc
>>>>>
>>>>> Im confused where we should draw the line when deciding to reference the 
>>>>> element and actually using it(as in directly calling "add_o_bag" in the 
>>>>> above example to click the element.
>>>>>
>>>>> Any thoughts?
>>>>>
>>>>>
>>>> --
>>>> --
>>>> Before posting, please read 
>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>> In short: search before you ask, be nice.
>>>>
>>>> watir-...@googlegroups.com
>>>> http://groups.google.com/group/watir-general
>>>> watir-genera...@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-genera...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> --
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>> In short: search before you ask, be nice.
>>
>> watir-general@googlegroups.com
>> http://groups.google.com/group/watir-general
>> watir-general+unsubscr

Re: [wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread Titus Fortner
Glad I could help, but now I'm going to go refactor everything so it
will be less confusing going forward. :)

On Thu, Sep 13, 2018 at 6:33 PM NaviHan  wrote:
>
> Got you, Titus
> The fundamental aspects are clear now.
>
> I will get back if I find a real case in my project that is not working as 
> per my understanding
>
> Thanks a million for taking time to clarify things. really appreciate it :-)
>
> Cheers
> Navi
>
> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>>
>> This is something that keeps me a bit sceptic when I write and read the 
>> automation code in my project.
>> This used PageObjects.
>>
>> I have seen extensive use of element referces, for example
>>
>> button(:add_to_bag, :css => '#add-to-cart')
>> add_to_bag.element.when_present.click
>>
>>
>>
>> instead of
>>
>> add_to_bag
>>
>> which directly clicks the element
>>
>> I have also seen extensive use of referencing elements using 
>> .when_present, .wait_until_present etc
>>
>> Im confused where we should draw the line when deciding to reference the 
>> element and actually using it(as in directly calling "add_o_bag" in the 
>> above example to click the element.
>>
>> Any thoughts?
>>
>>
> --
> --
> Before posting, please read 
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread Titus Fortner
I still don't understand the scenario. If it finds an element at the locator 
provided, it will stop on a wait_until_present and keep polling on a 
wait_while_present. Vice versa if an element is not found at that locator. If 
you have dynamic things happening, your test logic needs to handle it. That 
might mean a combination of the methods we're discussing, or a polite request 
of the app devs to add a class for after the transition has happened. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread Titus Fortner
What action are you trying to accomplish? It sometimes changes back which 
breaks things? I need to understand the scenario better. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread Titus Fortner
Ack, I was wrong about that.

`#wait_while_present` is equivalent to this:

Watir::Wait.while do
browser.element(class: 'here').present?
end

As soon as it does not find the element it is waiting while for, it will 
exit the waiting loop. If you want to wait for it to go away then come 
back, you'll need to wait_while_present then wait_until_present.


On Thursday, September 13, 2018 at 4:33:27 PM UTC-7, NaviHan wrote:
>
> Hi Titus
>
> This statement
>
> These are effectively equivalent because it is ignoring cache:
>
> my_element.wait_while_present
> browser.element(class: 'here').wait_while(&:present)
>
>
> Do you mean wait_while_present = wait_while(&:present)  --> "present 
> without question mark"
>
> To conclude
>
> wait_while_present will successfully wait when the class transition as 
> "here" to "not-here" to "here"
>
> Cheers
>
> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>>
>> This is something that keeps me a bit sceptic when I write and read the 
>> automation code in my project.
>> This used PageObjects.
>>
>> I have seen extensive use of element referces, for example 
>>
>> button(:add_to_bag, :css => '#add-to-cart')
>> add_to_bag.element.when_present.click
>>
>>
>>
>> instead of 
>>
>> add_to_bag 
>>
>> which directly clicks the element
>>
>> I have also seen extensive use of referencing elements using 
>> .when_present, .wait_until_present etc
>>
>> Im confused where we should draw the line when deciding to reference the 
>> element and actually using it(as in directly calling "add_o_bag" in the 
>> above example to click the element.
>>
>> Any thoughts?
>>
>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread Titus Fortner
If the element's class is changed to 'not-here' and Watir is looking for 
'here', then it won't find it and wait_while_present would exit.

This will exit immediately:

my_element = browser.element(class: 'here')
dynamically_change_class(my_element)
my_element.wait_while_present

These are effectively equivalent because it is ignoring cache:

my_element.wait_while_present
browser.element(class: 'here').wait_while(&:present)




On Thursday, September 13, 2018 at 2:39:50 PM UTC-7, NaviHan wrote:
>
> Yes Titus, I got that.
>
> But for that fresh retry from scratch to work, the class of the element 
> has to go back to "here" from "not-here" isnt it?
>
> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>>
>> This is something that keeps me a bit sceptic when I write and read the 
>> automation code in my project.
>> This used PageObjects.
>>
>> I have seen extensive use of element referces, for example 
>>
>> button(:add_to_bag, :css => '#add-to-cart')
>> add_to_bag.element.when_present.click
>>
>>
>>
>> instead of 
>>
>> add_to_bag 
>>
>> which directly clicks the element
>>
>> I have also seen extensive use of referencing elements using 
>> .when_present, .wait_until_present etc
>>
>> Im confused where we should draw the line when deciding to reference the 
>> element and actually using it(as in directly calling "add_o_bag" in the 
>> above example to click the element.
>>
>> Any thoughts?
>>
>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread Titus Fortner
#wait_while_present will do a #reset! (remove the cache of the driver 
object) and attempt to locate the element from scratch with the selector 
`{class: "here"}`. If it finds it, then the wait loop will continue, if it 
does not find it, it will exit out of the waiting loop.

Incidentally, I think I've found a way to make that the default behavior 
for `wait_until(&:present?)` so I might be deprecating 
`#wait_while_present` and `#wait_until_present` entirely to minimize this 
confusion.




On Thursday, September 13, 2018 at 2:22:00 PM UTC-7, NaviHan wrote:
>
> Thanks a lot Titus and Rajagopalan.
>
> I want to wrap this up with one more question about wait_while_present. 
> Had this confusion while reading Titus's article on Watir waits (
> http://watir.com/guides/waiting/)
>
> you have this element, Foo and you locate it with 
> code "element = browser.div(class: "here")"
>
> Some dynamic event caused the element class to change: " class="not-here">Foo"
>
> In this case we want the element to be looked up from scratch during the 
> polling, which is what this does:
>
> element.wait_while_present
>
> But my question is becasue the class of the element has changed to 
> "not-here" how the wait_while_present is going to work, basically the 
> identifier has changed?
>
> Or did you mean that the class has changed from "here" to "not-here" and 
> again it changed back to "here" ??
>
> Cheers
> Navi
>
> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>>
>> This is something that keeps me a bit sceptic when I write and read the 
>> automation code in my project.
>> This used PageObjects.
>>
>> I have seen extensive use of element referces, for example 
>>
>> button(:add_to_bag, :css => '#add-to-cart')
>> add_to_bag.element.when_present.click
>>
>>
>>
>> instead of 
>>
>> add_to_bag 
>>
>> which directly clicks the element
>>
>> I have also seen extensive use of referencing elements using 
>> .when_present, .wait_until_present etc
>>
>> Im confused where we should draw the line when deciding to reference the 
>> element and actually using it(as in directly calling "add_o_bag" in the 
>> above example to click the element.
>>
>> Any thoughts?
>>
>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread Titus Fortner
As of 6.13 you can now that wait like this:

b.label(id: 'something').wait_until(text: 'Expected Text')


On Thursday, September 13, 2018 at 4:40:53 AM UTC-7, rajagopalan madasami 
wrote:
>
> Hi Navi,
>
> yes, you are right with your understanding.
>
> WATIR locates elements completely different from Selenium
>
> When you write, 
>
> element=b.span(id: 'click')
>
> It doesn't locate the element, but when you write
>
> element.click
>
> it locates the element and continue to perform the click operation, this 
> arrangement is useful to relocate the element when element goes to stale, 
> waiting until element is visible and likewise this arrangement is useful 
> for cases. Technically this should include even when I call text method as 
> well. But I do in my project here is,
>
> I write code like
>
> b.wait_until(b.label(id: 'something').text?'Expected Text')
>
> This will reexecute the statement for 30 seconds, otherwise it would throw 
> the error
>
> Or 
>
> b.label(id: 'something').wait_until{|element| element.text.eql?'Expected 
> Text'}
>
>
>
> On Thu, Sep 13, 2018 at 11:16 AM NaviHan  > wrote:
>
>> Hi Titus
>>
>> Thats makes it very clear now :-)
>>
>> Just to confirm, action methods as in set, click, select
>> And the reading attribute values like id, text, or any other custom 
>> attribute are not auto covered and we need to use wait_until(&:present?)
>>
>> Is that correct?
>>
>> Cheers
>> Navi
>>
>> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>>>
>>> This is something that keeps me a bit sceptic when I write and read the 
>>> automation code in my project.
>>> This used PageObjects.
>>>
>>> I have seen extensive use of element referces, for example 
>>>
>>> button(:add_to_bag, :css => '#add-to-cart')
>>> add_to_bag.element.when_present.click
>>>
>>>
>>>
>>> instead of 
>>>
>>> add_to_bag 
>>>
>>> which directly clicks the element
>>>
>>> I have also seen extensive use of referencing elements using 
>>> .when_present, .wait_until_present etc
>>>
>>> Im confused where we should draw the line when deciding to reference the 
>>> element and actually using it(as in directly calling "add_o_bag" in the 
>>> above example to click the element.
>>>
>>> Any thoughts?
>>>
>>>
>>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread Titus Fortner
Ok, yes. This is a slight simplification, but think of Watir waiting for 
what makes the most sense for the provided method.

1. Status Queries --> No automatic waits; immediate response or exception
#exists? / #visible? / #present? / #enabled? 

2. Information Queries --> Automatically waits until exists in DOM
#text / #value / #tag_name / #style / #attribute_value etc

3. Actions --> Automatically waits until displayed to user
#click / #submit / #set / #clear / #select



On Wednesday, September 12, 2018 at 10:46:27 PM UTC-7, NaviHan wrote:
>
> Hi Titus
>
> Thats makes it very clear now :-)
>
> Just to confirm, action methods as in set, click, select
> And the reading attribute values like id, text, or any other custom 
> attribute are not auto covered and we need to use wait_until(&:present?)
>
> Is that correct?
>
> Cheers
> Navi
>
> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>>
>> This is something that keeps me a bit sceptic when I write and read the 
>> automation code in my project.
>> This used PageObjects.
>>
>> I have seen extensive use of element referces, for example 
>>
>> button(:add_to_bag, :css => '#add-to-cart')
>> add_to_bag.element.when_present.click
>>
>>
>>
>> instead of 
>>
>> add_to_bag 
>>
>> which directly clicks the element
>>
>> I have also seen extensive use of referencing elements using 
>> .when_present, .wait_until_present etc
>>
>> Im confused where we should draw the line when deciding to reference the 
>> element and actually using it(as in directly calling "add_o_bag" in the 
>> above example to click the element.
>>
>> Any thoughts?
>>
>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: How often to get element reference, best practice?

2018-09-12 Thread Titus Fortner
Yeah, it is automatic only for action methods, which does not include text.
There's a case to be made to extend that behavior to text since it will
return an empty string if it isn't displayed, but for now you'll need to
keep the wait.



On Wed, Sep 12, 2018, 8:19 PM NaviHan  wrote:

> Hi Titus
>
> Thanks for the detailed explanation and the documentation link.
> Unfortunately my confusion doesnt get clarified.
>
> As you said for an element which eventually displays, for example a pop up
> that appears due to a user action, we can read the text by
>
> *scenario 1*
> "my_element.when_present.text" because when_present get info from element
> that eventually *displays*
>
> The above changed to my_element.text, post Watir6.0 as the wait was made
> automatic
>
> *scenario 2*
> "my_element.wait_until(&:present?).text" also waits for the element to be
> displayed like "my_element.when_present.text"
> So they are one and the same.
>
> Because they are one and the same and post Watir6.0 the when_present wait
> was made automatic we can achieve the above objective with "my_element.text"
>
> So there will never be a case where we have to use wait_until(&:present?).
>
> This is my theory.
> Is that correct?
>
> Cheers
> Navi
>
>
> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>>
>> This is something that keeps me a bit sceptic when I write and read the
>> automation code in my project.
>> This used PageObjects.
>>
>> I have seen extensive use of element referces, for example
>>
>> button(:add_to_bag, :css => '#add-to-cart')
>> add_to_bag.element.when_present.click
>>
>>
>>
>> instead of
>>
>> add_to_bag
>>
>> which directly clicks the element
>>
>> I have also seen extensive use of referencing elements using 
>> .when_present, .wait_until_present etc
>>
>> Im confused where we should draw the line when deciding to reference the 
>> element and actually using it(as in directly calling "add_o_bag" in the 
>> above example to click the element.
>>
>> Any thoughts?
>>
>>
>> --
> --
> Before posting, please read
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How often to get element reference, best practice?

2018-09-12 Thread Titus Fortner
Hey Navi, I'm sorry there is so much confusion around the waits. If there 
is something that would make this article 
(http://watir.com/guides/waiting/) more clear, please let me know so I can 
make it better. Maybe I spend too much time focusing on history and 
implementation details that don't matter to you?


Best practice before Watir 6:

Scenario one, click element that eventually displays:
my_element.when_present.click

Scenario two, get info from element that eventually displays:
my_element.when_present.get_attribute('class')

Secnario three, wait for one element then act on another:
my_element1.wait_until_present
my_element2.click

For the first scenario, 
since your test shouldn't attempt to click an element that isn't present, 
Watir 6 made the waiting automatic.

This will now do the exact same thing:
my_element.click

Scenario 2:
Watir waits for the element to exist, but not for it to be displayed. So if 
it needs to be displayed first (usually some kind of dynamic activity on 
the page):

element.wait_until(&:present?).attribute_value('class')

Scenario 3:

element_one.wait_until(&:present?)
element_two.click


We are encouraging everyone to move to the to_proc notation `&:` with the 
wait methods. This drastically simplifies the code we have to maintain 
relative to the benefit to our users. We do still have 
`#wait_until_present` and `#wait_while_present` methods to handle some 
special use cases, but these may go away as well.

Does this clarify things more?




On Tuesday, September 11, 2018 at 9:49:37 PM UTC-7, NaviHan wrote:
>
>
> Hi Titus
>
> You said "when_present" and 'wait_until(&:present?)" does the same thing, 
> which is Waits for element to be present, the former is deprecated and 
> latter is recommended.
>
> Why is that if bot does the same thing
>
> Im trying to understand if "wait_until(&:present?)" is in any ways 
> different from "when_present" eventhough its deprecated.
>
>
> Justin also mentioned on version 6.0 of Watir you made changes to 
> automatically wait for elements before taking actions which let us do away 
> ith "when_present". So I still do not understand why we should ever use 
> wait_until(&:present?) at all.
>
> Sorry if I sound stupid, becasue there is so much cinfusion around waits 
> :-(
>
> Cheers
> Navi
>
> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>>
>> This is something that keeps me a bit sceptic when I write and read the 
>> automation code in my project.
>> This used PageObjects.
>>
>> I have seen extensive use of element referces, for example 
>>
>> button(:add_to_bag, :css => '#add-to-cart')
>> add_to_bag.element.when_present.click
>>
>>
>>
>> instead of 
>>
>> add_to_bag 
>>
>> which directly clicks the element
>>
>> I have also seen extensive use of referencing elements using 
>> .when_present, .wait_until_present etc
>>
>> Im confused where we should draw the line when deciding to reference the 
>> element and actually using it(as in directly calling "add_o_bag" in the 
>> above example to click the element.
>>
>> Any thoughts?
>>
>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: Watir [DEPRECATION] ["stale_present"] Checking `#present? == false`

2018-09-11 Thread Titus Fortner
Good news. I figured out how to minimize this message. Everything should be 
better in 6.14. :)



On Tuesday, September 11, 2018 at 8:54:49 AM UTC-7, Titus Fortner wrote:
>
> The deprecation message is thrown when rescuing a stale exception during a 
> call for #exists? / #visible? #present? because when we make the code 
> changes below, tests that rely on this behavior will fail. They need to 
> know about it, so there needs to be a message. Yes, the message is 
> happening even in use cases that won't change, so I'll need to adjust the 
> message.
>
> As for the specific code I suggested, you wouldn't be getting a stale 
> element warning if the element was in the DOM and merely not displayed. As 
> such `wait_while(&:exists?)` would do what you need it to do just fine. 
> Alternately, the method `#wait_while_present` should work as well since it 
> is constantly locating from scratch. Yes, this is just for the element 
> going away. To deal with the element showing up and then going away is a 
> completely separate concern.
>
> Also, for note, specific requests for changing code are better done as 
> github issues so I can keep track of them. 
>
>
>
>
>
>
> On Tuesday, September 11, 2018 at 5:04:45 AM UTC-7, rajagopal...@gmail.com 
> wrote:
>>
>> element.wait_while(&:exists?)
>>
>>
>> No, this wouldn't work, I have to wait until the element is visible, 
>> element becomes invisible when loading completes.
>>
>> And also, I am checking whether element is visible or not, I am checking 
>> whether previously located element exist in the DOM. So this line 
>> b.div().wait_until_present or b.div.wait_until(&:present) perfectly needed 
>> for my program. 
>>
>> I am well aware of how element is located in selenium and WATIR. but I 
>> don't understand the deprecation message has to be thrown such a meaningful 
>> method. Please remove this message completely. 
>>
>> Thanks.
>>
>> On Thursday, September 6, 2018 at 7:14:13 AM UTC+5:30, Titus Fortner 
>> wrote:
>>>
>>> This is another example of the deprecation notice being thrown more 
>>> often than it should be. I've verified that your code will work after my 
>>> planned deprecation. I can't figure out how to restrict this deprecation 
>>> notice, so I'll add something to the message.
>>>
>>> Right now, to avoid that notice, you can do: element.wait_while(&
>>> :exists?)
>>>
>>> Watir and Selenium have fundamentally different ideas of what an element 
>>> "is." A Selenium Element is defined by the object reference returned by the 
>>> driver. If that reference is no longer valid, the element no longer exists. 
>>> A Watir Element is whatever exists is at the provided locator, period. The 
>>> Watir approach is more useful if you are focused on testing functionality 
>>> vs implementation. When watir-webdriver was created, a lot of Selenium 
>>> implementation ideas creeped into Watir. This refactoring is make the 
>>> distinction more consistent with the original intentions of Watir. 
>>>
>>> If a Watir user cares about the Selenium notion of what an element is, 
>>> we've provided the `#stale?` method to allow you to figure out if the 
>>> driver object has gone away. Additionally, for performance reasons Watir 
>>> caches the Selenium element and tries to re-use it whenever possible. which 
>>> adds a bit of extra complexity.
>>>
>>> If you're curious, the refactoring is going to change #exists? from this:
>>>
>>> def exists?
>>>   return false if located? && stale?
>>>   assert_exists
>>>   true
>>> rescue UnknownObjectException, UnknownFrameException
>>>   false
>>> end
>>>
>>>
>>> to this:
>>>
>>> def exists?
>>>   if located? && stale?
>>> reset!
>>>   elsif located?
>>> return true
>>>   end
>>>
>>>   assert_exists
>>>   true
>>> rescue UnknownObjectException, UnknownFrameException
>>>   false
>>> end
>>>
>>>
>>> and `#present?` will look like:
>>>
>>> def present?
>>>   begin
>>> assert_exists
>>> @element.displayed?
>>>   rescue Selenium::WebDriver::Error::StaleElementReferenceError
>>> reset!
>>> retry # (this was changed from just returning false)
>>>   rescue UnknownObjectException, UnknownFrame

[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread Titus Fortner
Oh man, that FAQ is kind of dated, and more confusing than I remember it 
being. I should tidy a couple things there.

The specific use case detailed in "Why are my tests taking so long?" 
section of that FAQ is going to be rare, and very unlikely to apply to you. 
So you should just ignore that one. :)

when_present - Waits for element to be present, now deprecated

wait_until(&:present?) - Waits for element to be present; this is 
recommended usage.

wait_until_present - this one is slightly trickier, and hopefully the need 
for it goes away in a future release. Essentially this method is needed in 
a very rare use case: the element is located, then goes away, and you want 
to wait for it to come 
back. http://watir.com/guides/waiting/#wait-until-present-and-wait-while-present

relaxed_locate = true is the default. Relaxed means that it will 
automatically wait for elements to be present if they are not.
relaxed_locate = false is for people who want to use Watir 6, but do not 
want the automatic waiting behaviors. (these are the people who had issues 
with the "Why are my tests taking so long?" section of the FAQ)

Watir 7 will be deprecating this setting entirely, and relaxed_locate will 
be true for everyone.




On Tuesday, September 11, 2018 at 7:40:29 AM UTC-7, NaviHan wrote:
>
> Hi Justin/Titus
>
> I have read the watit 6.0 release notes and FAQ @ 
> http://watir.com/watir-6-faq/#H
> Thanks a lot for giving the valuable info.
>
> Until now I was under the impression that "element.when_present" & 
> "element.wait_until(&:present)", but reading the notes I understood that 
> they are different.
>
> Arent both waiting for deafult of "30" seconds for the element to be 
> present? What is the difference between the two? 
>
> On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote:
>>
>> This is something that keeps me a bit sceptic when I write and read the 
>> automation code in my project.
>> This used PageObjects.
>>
>> I have seen extensive use of element referces, for example 
>>
>> button(:add_to_bag, :css => '#add-to-cart')
>> add_to_bag.element.when_present.click
>>
>>
>>
>> instead of 
>>
>> add_to_bag 
>>
>> which directly clicks the element
>>
>> I have also seen extensive use of referencing elements using 
>> .when_present, .wait_until_present etc
>>
>> Im confused where we should draw the line when deciding to reference the 
>> element and actually using it(as in directly calling "add_o_bag" in the 
>> above example to click the element.
>>
>> Any thoughts?
>>
>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: Watir [DEPRECATION] ["stale_present"] Checking `#present? == false`

2018-09-11 Thread Titus Fortner
The deprecation message is thrown when rescuing a stale exception during a 
call for #exists? / #visible? #present? because when we make the code 
changes below, tests that rely on this behavior will fail. They need to 
know about it, so there needs to be a message. Yes, the message is 
happening even in use cases that won't change, so I'll need to adjust the 
message.

As for the specific code I suggested, you wouldn't be getting a stale 
element warning if the element was in the DOM and merely not displayed. As 
such `wait_while(&:exists?)` would do what you need it to do just fine. 
Alternately, the method `#wait_while_present` should work as well since it 
is constantly locating from scratch. Yes, this is just for the element 
going away. To deal with the element showing up and then going away is a 
completely separate concern.

Also, for note, specific requests for changing code are better done as 
github issues so I can keep track of them. 






On Tuesday, September 11, 2018 at 5:04:45 AM UTC-7, rajagopal...@gmail.com 
wrote:
>
> element.wait_while(&:exists?)
>
>
> No, this wouldn't work, I have to wait until the element is visible, 
> element becomes invisible when loading completes.
>
> And also, I am checking whether element is visible or not, I am checking 
> whether previously located element exist in the DOM. So this line 
> b.div().wait_until_present or b.div.wait_until(&:present) perfectly needed 
> for my program. 
>
> I am well aware of how element is located in selenium and WATIR. but I 
> don't understand the deprecation message has to be thrown such a meaningful 
> method. Please remove this message completely. 
>
> Thanks.
>
> On Thursday, September 6, 2018 at 7:14:13 AM UTC+5:30, Titus Fortner wrote:
>>
>> This is another example of the deprecation notice being thrown more often 
>> than it should be. I've verified that your code will work after my planned 
>> deprecation. I can't figure out how to restrict this deprecation notice, so 
>> I'll add something to the message.
>>
>> Right now, to avoid that notice, you can do: element.wait_while(&:exists?
>> )
>>
>> Watir and Selenium have fundamentally different ideas of what an element 
>> "is." A Selenium Element is defined by the object reference returned by the 
>> driver. If that reference is no longer valid, the element no longer exists. 
>> A Watir Element is whatever exists is at the provided locator, period. The 
>> Watir approach is more useful if you are focused on testing functionality 
>> vs implementation. When watir-webdriver was created, a lot of Selenium 
>> implementation ideas creeped into Watir. This refactoring is make the 
>> distinction more consistent with the original intentions of Watir. 
>>
>> If a Watir user cares about the Selenium notion of what an element is, 
>> we've provided the `#stale?` method to allow you to figure out if the 
>> driver object has gone away. Additionally, for performance reasons Watir 
>> caches the Selenium element and tries to re-use it whenever possible. which 
>> adds a bit of extra complexity.
>>
>> If you're curious, the refactoring is going to change #exists? from this:
>>
>> def exists?
>>   return false if located? && stale?
>>   assert_exists
>>   true
>> rescue UnknownObjectException, UnknownFrameException
>>   false
>> end
>>
>>
>> to this:
>>
>> def exists?
>>   if located? && stale?
>> reset!
>>   elsif located?
>> return true
>>   end
>>
>>   assert_exists
>>   true
>> rescue UnknownObjectException, UnknownFrameException
>>   false
>> end
>>
>>
>> and `#present?` will look like:
>>
>> def present?
>>   begin
>> assert_exists
>> @element.displayed?
>>   rescue Selenium::WebDriver::Error::StaleElementReferenceError
>>     reset!
>> retry # (this was changed from just returning false)
>>   rescue UnknownObjectException, UnknownFrameException
>> false
>>   end
>> end
>>
>>
>>
>>
>>
>> On Wednesday, September 5, 2018 at 9:31:12 AM UTC-7, rajagopalan madasami 
>> wrote:
>>>
>>> Yes I am asking the former, I need to wait until spinner goes away. So 
>>> former one is necessary for me. Buy why do you plan to deprecate such a 
>>> good method which is very much necessary?
>>>
>>> On Wed 5 Sep, 2018, 8:06 PM Titus Fortner,  wrote:
>>>
>>>> It has to do with how Watir caches elements and being consistent in

Re: [wtr-general] Re: Watir [DEPRECATION] ["stale_present"] Checking `#present? == false`

2018-09-05 Thread Titus Fortner
This is another example of the deprecation notice being thrown more often 
than it should be. I've verified that your code will work after my planned 
deprecation. I can't figure out how to restrict this deprecation notice, so 
I'll add something to the message.

Right now, to avoid that notice, you can do: element.wait_while(&:exists?)

Watir and Selenium have fundamentally different ideas of what an element 
"is." A Selenium Element is defined by the object reference returned by the 
driver. If that reference is no longer valid, the element no longer exists. 
A Watir Element is whatever exists is at the provided locator, period. The 
Watir approach is more useful if you are focused on testing functionality 
vs implementation. When watir-webdriver was created, a lot of Selenium 
implementation ideas creeped into Watir. This refactoring is make the 
distinction more consistent with the original intentions of Watir. 

If a Watir user cares about the Selenium notion of what an element is, 
we've provided the `#stale?` method to allow you to figure out if the 
driver object has gone away. Additionally, for performance reasons Watir 
caches the Selenium element and tries to re-use it whenever possible. which 
adds a bit of extra complexity.

If you're curious, the refactoring is going to change #exists? from this:

def exists?
  return false if located? && stale?
  assert_exists
  true
rescue UnknownObjectException, UnknownFrameException
  false
end


to this:

def exists?
  if located? && stale?
reset!
  elsif located?
return true
  end

  assert_exists
  true
rescue UnknownObjectException, UnknownFrameException
  false
end


and `#present?` will look like:

def present?
  begin
assert_exists
@element.displayed?
  rescue Selenium::WebDriver::Error::StaleElementReferenceError
reset!
retry # (this was changed from just returning false)
  rescue UnknownObjectException, UnknownFrameException
false
  end
end





On Wednesday, September 5, 2018 at 9:31:12 AM UTC-7, rajagopalan madasami 
wrote:
>
> Yes I am asking the former, I need to wait until spinner goes away. So 
> former one is necessary for me. Buy why do you plan to deprecate such a 
> good method which is very much necessary?
>
> On Wed 5 Sep, 2018, 8:06 PM Titus Fortner,  > wrote:
>
>> It has to do with how Watir caches elements and being consistent in how 
>> it responds.
>>
>> "#present?" is asking "can a user see an element at this location?"
>> This is different from "did the element I previously located change?"
>>
>> If you are asking the former, you're fine. If you are asking the latter, 
>> you might need to change your code.
>> I can take another pass at making sure the warning is sufficiently narrow.
>>
>>
>>
>> On Wednesday, September 5, 2018 at 12:01:15 AM UTC-7, 
>> rajagopal...@gmail.com wrote:
>>>
>>> Hi Titus,
>>>
>>> I am getting this warning while I execute this code
>>>
>>>>
>>>> @b.span(class: "spinner").wait_while(&:present?)
>>>>
>>>>
>>>  2018-09-05 12:26:45 WARN Watir [DEPRECATION] ["stale_present"] Checking 
>>> `#present? == false` to determine a stale element is deprecated. Use 
>>> `#stale? == true` instead.
>>>
>>> If I use 
>>>
>>> @b.span(class: "spinner").wait_until(&:stale?)
>>>>
>>>>
>>> Watir::Exception::Error: Can not check staleness of unused element
>>>
>>>   0) scenario1-Contact Example
>>>  ?[31mFailure/Error: raise Watir::Exception::Error, "Can not check 
>>> staleness of unused element" unless @element?[0m
>>>  ?[31m?[0m
>>>  ?[31mWatir::Exception::Error:?[0m
>>>  ?[31m  Can not check staleness of unused element?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Chrome.rb:168:in 
>>> `waitForPageLoad'?[0m
>>>  ?[36m# ./Source/LoginModule/login.rb:72:in `driverSing'?[0m
>>>  ?[36m# ./Source/FrameWorkModules/PullTheTestCases.rb:7:in 
>>> `initialize'?[0m
>>>  ?[36m# ./Source/Contact_Create_spec.rb:36:in `new'?[0m
>>>  ?[36m# ./Source/Contact_Create_spec.rb:36:in `block (4 levels) in 
>>> '?[0m
>>>
>>> Why can't I use `@b.span(class: "spinner").wait_while(&:present?)` ? 
>>> Hi, I am designing a common framework for all of my project in my company 
>>> using WATIR. So this kind of code in my Framework level is pretty 
>>> important. Can you please let me know why it is deprecated? 
>>>
>> -- 
>

[wtr-general] Re: Watir [DEPRECATION] ["stale_present"] Checking `#present? == false`

2018-09-05 Thread Titus Fortner
It has to do with how Watir caches elements and being consistent in how it 
responds.

"#present?" is asking "can a user see an element at this location?"
This is different from "did the element I previously located change?"

If you are asking the former, you're fine. If you are asking the latter, 
you might need to change your code.
I can take another pass at making sure the warning is sufficiently narrow.



On Wednesday, September 5, 2018 at 12:01:15 AM UTC-7, 
rajagopal...@gmail.com wrote:
>
> Hi Titus,
>
> I am getting this warning while I execute this code
>
>>
>> @b.span(class: "spinner").wait_while(&:present?)
>>
>>
>  2018-09-05 12:26:45 WARN Watir [DEPRECATION] ["stale_present"] Checking 
> `#present? == false` to determine a stale element is deprecated. Use 
> `#stale? == true` instead.
>
> If I use 
>
> @b.span(class: "spinner").wait_until(&:stale?)
>>
>>
> Watir::Exception::Error: Can not check staleness of unused element
>
>   0) scenario1-Contact Example
>  ?[31mFailure/Error: raise Watir::Exception::Error, "Can not check 
> staleness of unused element" unless @element?[0m
>  ?[31m?[0m
>  ?[31mWatir::Exception::Error:?[0m
>  ?[31m  Can not check staleness of unused element?[0m
>  ?[36m# ./Source/FrameWorkModules/Chrome.rb:168:in 
> `waitForPageLoad'?[0m
>  ?[36m# ./Source/LoginModule/login.rb:72:in `driverSing'?[0m
>  ?[36m# ./Source/FrameWorkModules/PullTheTestCases.rb:7:in 
> `initialize'?[0m
>  ?[36m# ./Source/Contact_Create_spec.rb:36:in `new'?[0m
>  ?[36m# ./Source/Contact_Create_spec.rb:36:in `block (4 levels) in 
> '?[0m
>
> Why can't I use `@b.span(class: "spinner").wait_while(&:present?)` ? Hi, 
> I am designing a common framework for all of my project in my company using 
> WATIR. So this kind of code in my Framework level is pretty important. Can 
> you please let me know why it is deprecated? 
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: NoSuchElementError

2018-09-04 Thread Titus Fortner
I mostly have the fix. There's some frame driver optimization that I realize is 
still needed. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: NoSuchElementError

2018-09-03 Thread Titus Fortner
Well, now we're running into another bug that has to do with how element 
collections are located, which requires fixing the way context is 
established so that we can apply it to both elements and collections.

This should fix it:
https://github.com/watir/watir/pull/771


On Monday, September 3, 2018 at 8:03:00 AM UTC-7, rajagopalan madasami 
wrote:
>
> Titus, something really bad happened, now select list is not waiting for 
> element to exist, it immediately throws the error. Previous version works 
> fine. Something is missed.
>
> On Mon 3 Sep, 2018, 11:49 AM Titus Fortner,  > wrote:
>
>> Excellent! I'm glad it won't be a prohibitive change.
>>
>>
>> On Sunday, September 2, 2018 at 10:44:09 PM UTC-7, rajagopal...@gmail.com 
>> wrote:
>>>
>>> Hi,
>>>
>>> I am sorry, It works fine. And you are absolutely right. Yes. 
>>>
>>> b.element(visible_text: 'Sessions').click
>>>>
>>>
>>> Takes much time
>>>
>>> but 
>>>
>>> b.link(visible_text: 'Sessions').click
>>>>
>>>
>>> Takes very less time.  
>>>
>>>
>>>
>>> On Sunday, September 2, 2018 at 11:45:04 PM UTC+5:30, 
>>> rajagopal...@gmail.com wrote:
>>>>
>>>> Sure, I will be in office tomorrow, so I will taking that element html 
>>>> and posting it here.
>>>>
>>>> I have posted a question in Stackover flow, can you please answer me 
>>>> there?
>>>>
>>>>
>>>> https://stackoverflow.com/questions/52130793/select-method-and-option-method-works-differently
>>>>
>>>> On Friday, August 31, 2018 at 12:28:27 AM UTC+5:30, Titus Fortner wrote:
>>>>>
>>>>> Can I see the html of the element you are trying to locate and the 
>>>>> locator you are trying to use? 
>>>>> On Thu, Aug 30, 2018 at 9:41 AM rajagopalan madasami 
>>>>>  wrote: 
>>>>> > 
>>>>> > Hi, I have checked it, when I use visible_text its not even finding 
>>>>> the element . Element not found error was thrown. 
>>>>> > 
>>>>> > On Thu 30 Aug, 2018, 4:59 AM Titus Fortner,  
>>>>> wrote: 
>>>>> >> 
>>>>> >> Yes, Watir is only going to iterate over the link elements instead 
>>>>> of all of the elements to find the matching text. If there is a class or 
>>>>> other attribute that would further filter out links, that would help as 
>>>>> well. It will still be a little slower as there will be more wire calls, 
>>>>> but I'm more concerned with having a consistent API than absolute 
>>>>> performance. 
>>>>> >> 
>>>>> >> For example: 
>>>>> >> `browser.link(class: 'foo', data_bar: 'bar', text: "Foo Bar")` 
>>>>> >> 
>>>>> >> Additionally, you can also try watigiri which will iterate over a 
>>>>> cached tree with a low level library, instead of making multiple wire 
>>>>> calls. watigiri is limited by not being able to distinguish between 
>>>>> "visible" and "non-visible" text. 
>>>>> >> 
>>>>> >> 
>>>>> >> 
>>>>> >> On Wednesday, August 29, 2018 at 4:19:47 PM UTC-7, rajagopalan 
>>>>> madasami wrote: 
>>>>> >>> 
>>>>> >>> Ah, okay , that makes difference? Okay let me check it today how 
>>>>> it works. 
>>>>> >>> 
>>>>> >>> On Thu 30 Aug, 2018, 4:12 AM Titus Fortner,  
>>>>> wrote: 
>>>>> >>>> 
>>>>> >>>> Are you using element or link method? 
>>>>> >>>> 
>>>>> >>>> -- 
>>>>> >>>> -- 
>>>>> >>>> Before posting, please read 
>>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>>>  
>>>>>
>>>>> >>>> In short: search before you ask, be nice. 
>>>>> >>>> 
>>>>> >>>> watir-...@googlegroups.com 
>>>>> >>>> http://groups.google.com/group/watir-general 
>>>>> >>>> watir-genera...@googlegroups.com 
>>>>

Re: [wtr-general] Re: NoSuchElementError

2018-09-02 Thread Titus Fortner
Excellent! I'm glad it won't be a prohibitive change.


On Sunday, September 2, 2018 at 10:44:09 PM UTC-7, rajagopal...@gmail.com 
wrote:
>
> Hi,
>
> I am sorry, It works fine. And you are absolutely right. Yes. 
>
> b.element(visible_text: 'Sessions').click
>>
>
> Takes much time
>
> but 
>
> b.link(visible_text: 'Sessions').click
>>
>
> Takes very less time.  
>
>
>
> On Sunday, September 2, 2018 at 11:45:04 PM UTC+5:30, 
> rajagopal...@gmail.com wrote:
>>
>> Sure, I will be in office tomorrow, so I will taking that element html 
>> and posting it here.
>>
>> I have posted a question in Stackover flow, can you please answer me 
>> there?
>>
>>
>> https://stackoverflow.com/questions/52130793/select-method-and-option-method-works-differently
>>
>> On Friday, August 31, 2018 at 12:28:27 AM UTC+5:30, Titus Fortner wrote:
>>>
>>> Can I see the html of the element you are trying to locate and the 
>>> locator you are trying to use? 
>>> On Thu, Aug 30, 2018 at 9:41 AM rajagopalan madasami 
>>>  wrote: 
>>> > 
>>> > Hi, I have checked it, when I use visible_text its not even finding 
>>> the element . Element not found error was thrown. 
>>> > 
>>> > On Thu 30 Aug, 2018, 4:59 AM Titus Fortner,  
>>> wrote: 
>>> >> 
>>> >> Yes, Watir is only going to iterate over the link elements instead of 
>>> all of the elements to find the matching text. If there is a class or other 
>>> attribute that would further filter out links, that would help as well. It 
>>> will still be a little slower as there will be more wire calls, but I'm 
>>> more concerned with having a consistent API than absolute performance. 
>>> >> 
>>> >> For example: 
>>> >> `browser.link(class: 'foo', data_bar: 'bar', text: "Foo Bar")` 
>>> >> 
>>> >> Additionally, you can also try watigiri which will iterate over a 
>>> cached tree with a low level library, instead of making multiple wire 
>>> calls. watigiri is limited by not being able to distinguish between 
>>> "visible" and "non-visible" text. 
>>> >> 
>>> >> 
>>> >> 
>>> >> On Wednesday, August 29, 2018 at 4:19:47 PM UTC-7, rajagopalan 
>>> madasami wrote: 
>>> >>> 
>>> >>> Ah, okay , that makes difference? Okay let me check it today how it 
>>> works. 
>>> >>> 
>>> >>> On Thu 30 Aug, 2018, 4:12 AM Titus Fortner,  
>>> wrote: 
>>> >>>> 
>>> >>>> Are you using element or link method? 
>>> >>>> 
>>> >>>> -- 
>>> >>>> -- 
>>> >>>> Before posting, please read 
>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>  
>>>
>>> >>>> In short: search before you ask, be nice. 
>>> >>>> 
>>> >>>> watir-...@googlegroups.com 
>>> >>>> http://groups.google.com/group/watir-general 
>>> >>>> watir-genera...@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-genera...@googlegroups.com. 
>>> >>>> For more options, visit https://groups.google.com/d/optout. 
>>> >> 
>>> >> -- 
>>> >> -- 
>>> >> Before posting, please read 
>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>  
>>>
>>> >> In short: search before you ask, be nice. 
>>> >> 
>>> >> watir-...@googlegroups.com 
>>> >> http://groups.google.com/group/watir-general 
>>> >> watir-genera...@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-genera...@googlegroups.com. 
>>> >> For more options, visit https://groups.google.com/d/optout. 
>>> > 
>>> > -- 
>>> > -- 
>>> > Before posting, please read 
>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>  
>>>
>>> > In short: search before you ask, be nice. 
>>> > 
>>> > watir-...@googlegroups.com 
>>> > http://groups.google.com/group/watir-general 
>>> > watir-genera...@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-genera...@googlegroups.com. 
>>> > For more options, visit https://groups.google.com/d/optout. 
>>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: NoSuchElementError

2018-08-30 Thread Titus Fortner
Can I see the html of the element you are trying to locate and the
locator you are trying to use?
On Thu, Aug 30, 2018 at 9:41 AM rajagopalan madasami
 wrote:
>
> Hi, I have checked it, when I use visible_text its not even finding the 
> element . Element not found error was thrown.
>
> On Thu 30 Aug, 2018, 4:59 AM Titus Fortner,  wrote:
>>
>> Yes, Watir is only going to iterate over the link elements instead of all of 
>> the elements to find the matching text. If there is a class or other 
>> attribute that would further filter out links, that would help as well. It 
>> will still be a little slower as there will be more wire calls, but I'm more 
>> concerned with having a consistent API than absolute performance.
>>
>> For example:
>> `browser.link(class: 'foo', data_bar: 'bar', text: "Foo Bar")`
>>
>> Additionally, you can also try watigiri which will iterate over a cached 
>> tree with a low level library, instead of making multiple wire calls. 
>> watigiri is limited by not being able to distinguish between "visible" and 
>> "non-visible" text.
>>
>>
>>
>> On Wednesday, August 29, 2018 at 4:19:47 PM UTC-7, rajagopalan madasami 
>> wrote:
>>>
>>> Ah, okay , that makes difference? Okay let me check it today how it works.
>>>
>>> On Thu 30 Aug, 2018, 4:12 AM Titus Fortner,  wrote:
>>>>
>>>> Are you using element or link method?
>>>>
>>>> --
>>>> --
>>>> Before posting, please read 
>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>> In short: search before you ask, be nice.
>>>>
>>>> watir-...@googlegroups.com
>>>> http://groups.google.com/group/watir-general
>>>> watir-genera...@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-genera...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> --
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>> 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 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+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> --
> Before posting, please read 
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: NoSuchElementError

2018-08-29 Thread Titus Fortner
Yes, Watir is only going to iterate over the link elements instead of all 
of the elements to find the matching text. If there is a class or other 
attribute that would further filter out links, that would help as well. It 
will still be a little slower as there will be more wire calls, but I'm 
more concerned with having a consistent API than absolute performance.

For example:
`browser.link(class: 'foo', data_bar: 'bar', text: "Foo Bar")`

Additionally, you can also try watigiri which will iterate over a cached 
tree with a low level library, instead of making multiple wire calls. 
watigiri is limited by not being able to distinguish between "visible" and 
"non-visible" text.



On Wednesday, August 29, 2018 at 4:19:47 PM UTC-7, rajagopalan madasami 
wrote:
>
> Ah, okay , that makes difference? Okay let me check it today how it works.
>
> On Thu 30 Aug, 2018, 4:12 AM Titus Fortner,  > wrote:
>
>> Are you using element or link method? 
>>
>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: NoSuchElementError

2018-08-29 Thread Titus Fortner
Are you using element or link method? 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: NoSuchElementError

2018-08-29 Thread Titus Fortner
You should be able to do a direct replacement with visible_text locator, just 
with the option of adding additional locators as desired. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: NoSuchElementError

2018-08-28 Thread Titus Fortner
Based on my reading of the w3c spec, I think IEDriver doesn't need to do 
this. The fix in Watir is easy enough, 
though: 
https://github.com/watir/watir/commit/84ca128739c1729bf8d8f46f92ae8a7c0ebfab0d

It'll be in the next release.

On Tuesday, August 28, 2018 at 11:02:58 AM UTC-7, rajagopalan madasami 
wrote:
>
> Thank you.
>
> On Tue 28 Aug, 2018, 11:31 PM Titus Fortner,  > wrote:
>
>> Interesting: 
>> https://github.com/SeleniumHQ/selenium/commit/406b8dab98ed7a06bbc35728fb2b061d068d9238
>> I'll dig into what this is supposed to be doing so I can figure out the 
>> fix.
>>
>> On Monday, August 27, 2018 at 9:40:02 PM UTC-7, rajagopalan madasami 
>> wrote:
>>>
>>> Beautiful, thanks.
>>>
>>> On Tue 28 Aug, 2018, 9:57 AM Lakshya Kapoor,  
>>> wrote:
>>>
>>>> Yup, here is the source for Watir::Select#select:
>>>>
>>>> def select(*str_or_rx)
>>>>   results = str_or_rx.flatten.map { |v| select_by v}
>>>>   results.firstend
>>>>
>>>>
>>>>
>>>> On Monday, August 27, 2018 at 9:01:04 PM UTC-7, rajagopalan madasami 
>>>> wrote:
>>>>>
>>>>> Ah ! Is it returning the value? I haven't noticed it so far. Let me 
>>>>> verify.
>>>>>
>>>>> On Tue 28 Aug, 2018, 9:29 AM Lakshya Kapoor,  
>>>>> wrote:
>>>>>
>>>>>> I have experienced the same in IE. The exception is raised when 
>>>>>> Watir::SelectList#select attempts to read the selected value and 
>>>>>> return it while the page is refreshing. My workaround was to use 
>>>>>> element.option(text: 
>>>>>> myvalue).select and then read the value separately through 
>>>>>> element.text.
>>>>>>
>>>>>> Should probably raise a bug report for this.
>>>>>>
>>>>>> -- 
>>>>>> -- 
>>>>>> Before posting, please read 
>>>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>>>>  
>>>>>>
>>>>>> In short: search before you ask, be nice.
>>>>>>  
>>>>>> watir-...@googlegroups.com
>>>>>> http://groups.google.com/group/watir-general
>>>>>> watir-genera...@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-genera...@googlegroups.com.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>> -- 
>>>> -- 
>>>> Before posting, please read 
>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>>  
>>>>
>>>> In short: search before you ask, be nice.
>>>>  
>>>> watir-...@googlegroups.com
>>>> http://groups.google.com/group/watir-general
>>>> watir-genera...@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-genera...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: NoSuchElementError

2018-08-28 Thread Titus Fortner
Interesting: 
https://github.com/SeleniumHQ/selenium/commit/406b8dab98ed7a06bbc35728fb2b061d068d9238
I'll dig into what this is supposed to be doing so I can figure out the fix.

On Monday, August 27, 2018 at 9:40:02 PM UTC-7, rajagopalan madasami wrote:
>
> Beautiful, thanks.
>
> On Tue 28 Aug, 2018, 9:57 AM Lakshya Kapoor,  > wrote:
>
>> Yup, here is the source for Watir::Select#select:
>>
>> def select(*str_or_rx)
>>   results = str_or_rx.flatten.map { |v| select_by v}
>>   results.firstend
>>
>>
>>
>> On Monday, August 27, 2018 at 9:01:04 PM UTC-7, rajagopalan madasami 
>> wrote:
>>>
>>> Ah ! Is it returning the value? I haven't noticed it so far. Let me 
>>> verify.
>>>
>>> On Tue 28 Aug, 2018, 9:29 AM Lakshya Kapoor,  
>>> wrote:
>>>
 I have experienced the same in IE. The exception is raised when 
 Watir::SelectList#select attempts to read the selected value and 
 return it while the page is refreshing. My workaround was to use 
 element.option(text: 
 myvalue).select and then read the value separately through 
 element.text.

 Should probably raise a bug report for this.

 -- 
 -- 
 Before posting, please read 
 https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
  

 In short: search before you ask, be nice.
  
 watir-...@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-genera...@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-genera...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>> -- 
>> -- 
>> Before posting, please read 
>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>  
>>
>> In short: search before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: Trouble reading the text from Popup , Using Watir and Pageobject

2018-08-09 Thread Titus Fortner
So are you thinking the popup had already gone away on remote? Are you
sure it was ever opened in the first place? 10 seconds should be
plenty of time to get information off of something. Is there something
happening on the site or in the code that would keep you from getting
that information in that 10 seconds?
On Wed, Aug 8, 2018 at 8:23 PM NaviHan  wrote:
>
> Yes Titus. I took the screenshot as well.
> It shows the homepage of the site, without the popup.
> Basically the popup appears on the homepage for 10second(this is driven by 
> config) and after 10 seconds it disappears. This is where we are trying to 
> read the text of the popup.
>
> The screenshot show the homepage without the popup...
>
> On Friday, 3 August 2018 15:12:45 UTC+10, NaviHan wrote:
>>
>> I have a functionality where I click an a link from an email a voucher gets 
>> added to the shopping cart and a pop up appears with a message. Im trying to 
>> assert the text in the popup
>> I have defined the element as
>>
>> div(:cta_description, :css => '.homepage-clicktoactiavte-description')
>>
>> Tried to use a mix of Watir and Pageobejct to read the text. The below code 
>> works 5 out of 10 times.
>>
>> @rewards_popup_txt = Watir::Wait.until{cta_description_element}.text
>> @rewards_popup_txt = @rewards_popup_txt.gsub(/[^$,.A-Za-z0-9]/," ")
>> return @rewards_popup_txt
>>
>>
>> Tried using, which doesnt even set the @reward_popup_txt and shows error
>>
>>
>> if (Watir::Wait.while {cta_description_element.visible?})
>>   @rewards_popup_txt = cta_description_element.text
>> end
>> @rewards_popup_txt = @rewards_popup_txt.gsub(/[^$,.A-Za-z0-9]/," ")
>> return @rewards_popup_txt
>>
>> Error
>> NoMethodError: undefined method `gsub' for nil:NilClass
>> ./features/support/pages/Frontend/Cotton_On/Loyalty_Page.rb:22:in 
>> `rewards_popup_description'
>>
>> Any stable way to do the job?
>
> --
> --
> Before posting, please read 
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
> 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 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Trouble reading the text from Popup , Using Watir and Pageobject

2018-08-08 Thread Titus Fortner
Can you take a screenshot? Often the problem part is the step before the error, 
so you need to actually see what is happening. No waiting strategy will work if 
the element never becomes present. 

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   >