Watir command to attach browser window does not work in radrails ide - watir

I use the radrails ide for running watir tests. I have the following command:
ie.link(:text, "Task").click
ie1=Watir::IE.attach(:title, 'Task')
Using the above command I get the error:
E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:760:in `rescue in attach_browser_window': Unable to locate a window with title of Task (Watir::Exception::NoMatchingWindowFoundException)
from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:755:in `attach_browser_window'
from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:157:in `_attach_init'
from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:151:in `attach'
from file.rb:31:in `<main>'
The Ruby version is 1.9.3, ie 8, html code of the page I want to attach -
<a id="sdmenu141" class="nodeSel" onclick="javascript: dmenu.s(141);" target="_self" href="javascript:configuredWindowOpen('../ROU/Mterou004p0001Form.do?resetFilter_‌​‌​action=','_blank','regular');">Task</a>
after clicking on the link in the first line of code it opens new browser window.
Also today I got a new error:
E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-cla‌​ss.rb:374:in method_missing': (in OLE method navigate': )
(WIN32OLERuntimeError) OLE error code:800700AA in <Unknown> <No Description> HRESULT error code:0x80020009
Exception occurred. from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-cla‌​ss.rb:374:in goto' from file.rb:7:in <main>'

Well, the error message says it all: Unable to locate a window with title of Task.

To resolve this issue use Watir Web Driver.

Related

Flutter Web - error output points to JS file instead of dart file

I have a Flutter Web project, and when an error is thrown, I can't open the dart file where the error was thrown, because the error line points to a JS file:
Launching lib\main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
This app is linked to the debug service: ws://127.0.0.1:63045/gOvW2paMrLg=/ws
Debug service listening on ws://127.0.0.1:63045/gOvW2paMrLg=/ws
Running with sound null safety
Debug service listening on ws://127.0.0.1:63045/gOvW2paMrLg=/ws
Error: Invalid argument(s): A value must be provided. Supported values: 0, 1
at Object.throw_ [as throw] (http://localhost:53846/dart_sdk.js:5061:11)
at Object._$36enumDecode [as _$enumDecode] (http://localhost:53846/packages/web_app/core/models/pessoa/pessoa.dart.lib.js:482:17)
at Object._$36PessoaFromJson [as _$PessoaFromJson] (http://localhost:53846/packages/web_app/core/models/pessoa/pessoa.dart.lib.js:473:54)
at Function.fromJson (http://localhost:53846/packages/web_app/core/models/pessoa/pessoa.dart.lib.js:375:21)
at http://localhost:53846/packages/web_app/repository/pessoa_repository.dart.lib.js:60:193
at repository.RepositoryGetter.new.getRecurso (http://localhost:53846/packages/web_app/repository/repository.dart.lib.js:33:18)
at getRecurso.next (<anonymous>)
at http://localhost:53846/dart_sdk.js:38640:33
at _RootZone.runUnary (http://localhost:53846/dart_sdk.js:38511:59)
at _FutureListener.thenAwait.handleValue (http://localhost:53846/dart_sdk.js:33713:29)
at handleValueCallback (http://localhost:53846/dart_sdk.js:34265:49)
at Function._propagateToListeners (http://localhost:53846/dart_sdk.js:34303:17)
at _Future.new.[_completeWithValue] (http://localhost:53846/dart_sdk.js:34151:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:53846/dart_sdk.js:34172:35)
at Object._microtaskLoop (http://localhost:53846/dart_sdk.js:38778:13)
at _startMicrotaskLoop (http://localhost:53846/dart_sdk.js:38784:13)
at http://localhost:53846/dart_sdk.js:34519:9
How can I make it to show the dart file where the error occurred, instead of a JS file?
I'm using Flutter Channel stable 2.5.2, Android Studio version 2020.3.
I have found a workaround for this issue.
You basically have to install a third-party patch; it will translate the paths in JS and point to the right line in dart file.
Download the patch and follow the instructions here: https://github.com/obeobe/flutter-web-exception-mapper
Optionally you can see trace of dart files in the browser.
Make sure you have source maps enabled in your browser.
got the answer from this link on github

"Element not found" exception in Jenkins box while script passing in local

Im trying to read the text from a popup and assert it.The element is defined as
div(:cta_description, :class => 'homepage-clicktoactiavte-description')
And the method as
def rewards_popup_description
return cta_description_element.when_present.text.gsub(/[^$,.A-Za-z0-9]/," ")
end
This script passes successfully while running in local, but fails with the following exception while running directly on Jenkins box which is another windows machine.
And the customer sees the overlay popup message "$10 reward activated"
features/step_definitions/Loyalty_steps.rb:7
timed out after 30 seconds, Element not present in 30 seconds (Watir::Wait::TimeoutError)
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.12.0/lib/watir/wait.rb:49:in `until'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.12.0/lib/watir/wait.rb:126:in `wait_until'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/page-object-2.2.4/lib/page-object/elements/element.rb:133:in `when_present'
D:/Jenkins/workspace/cog-checkout-loyalty-nightly-cuke-tests/cuke-tests/features/support/pages/Frontend/Cotton_On/Loyalty_Page.rb:14:in `rewards_popup_description'
D:/Jenkins/workspace/cog-checkout-loyalty-nightly-cuke-tests/cuke-tests/features/step_definitions/Loyalty_steps.rb:9:in `block (2 levels) in '
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/page-object-2.2.4/lib/page-object/page_factory.rb:75:in `on_page'
D:/Jenkins/workspace/cog-checkout-loyalty-nightly-cuke-tests/cuke-tests/features/step_definitions/Loyalty_steps.rb:8:in `block in '
C:/Ruby24-x64/bin/cucumber:23:in `load'
C:/Ruby24-x64/bin/cucumber:23:in `'
features/Loyalty-AU.feature:122:in `And the customer sees the overlay popup message "$10 reward activated"'
Both the machines have same version of following packages
page-object (2.2.4)
watir (6.12.0)
watir-scroll (0.2.0)
watir-webdriver (0.9.9)
Both the machines use same version of chromedriver as well
$ chromedriver.exe -v
ChromeDriver 2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e)
C:\Program Files (x86)\Google\Chrome\Application>chromedriver.exe -v
ChromeDriver 2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e)
Any idea what could be wrong?
Note:-
I ran the script directly from Jenkins box. Its a Windows Server 2016 edition.When the script runs I can see the popup appears and its stays for 10seconds(configured time) and then disappears. Then it fails complaining "Element no found".
The local is Windows 7 machine..

After edit twig file using theme editor, webisite show http error 500

I am new to opencart. So the case is I was trying to change the layout of the side menu. So I went to theme editor of opencart admin backend and edit the header.twig file. Then my site immediately went down. I tried reset the file but no help. Below are some details.
Opencart version: 3.0.2.0
Template used: Not default template(It is Laparis: Demo 7)
File edited: header.twig(Already reset but no help)
Error message from log:
[28-Sep-2017 02:32:46 UTC] PHP Fatal error: Uncaught exception
'Twig_Error_Syntax' with message 'Unknown "str_replace" function in "__string_template__85be79fc1c90839e75914d8e962e8d511d190b089fb189c9253a6adf4e71ae9f" at line 16.' in /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php:574
Stack trace:
#0 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(351): Twig_ExpressionParser->getFunctionNodeClass('str_replace', 16)
#1 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(144): Twig_ExpressionParser->getFunctionNode('str_replace', 16)
#2 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(84): Twig_ExpressionParser->parsePrimaryExpression()
#3 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(41): Twig_ExpressionParser->getPrimary()
#4 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(91): Twig_ExpressionParser->parseExpression()
#5 /home/gloo/public_html/newgloo/system/lib in /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php on line 574
Another error log from ocartdata/storage/logs:
PHP Warning: Cannot modify header information - headers already sent by (output started at /home/gloo/public_html/newgloo/admin/model/bossthemes/boss_newmegamenu.php:1) in /home/gloo/public_html/newgloo/system/library/response.php on line 36
I thought it might be the cache issue, so I cleared all cache. But still no luck.
Please tell me what can I do to make my site up again. Any help on this is much appreciated. Thanks.

Critical error while starting Eclipse (neon-3-linux-gtk-x86_64) for Java EE developer

First of all, I tried to run eclipse (eclipse-jee-neon-3-linux-gtk-x86_64) normally. Each time, it showed a splash screen for few seconds and disappers. Then I check with terminal. Running in the terminal with command ./eclipse prints the error messages. I have attached the full terminal output below.
nalin#nalin:/opt/eclipse-neon$ ./eclipse
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
(Eclipse:5741): GLib-CRITICAL **: g_base64_encode_step: assertion 'in != NULL' failed
Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.epp.internal.mpc.ui.wizards.MarketplaceDropAdapter$1
Any idea what's going on ?

unable to run j2me app in emulator

i am trying to run j2me app in emulator using eclipse but when i run the app i am getting following error
Error installing IMlet. See logs for details.
i tried to explore different thread but could not get definite answer.it asks to download IMlet Suite but i didnt find a place from where i can download it.
i am using windows 8 64bit machine
i am pretty new to this so please guide accordingly.
when i m trying to run following command
C:\WTK22\bin>emulator.bat
it shows following error
C:\WTK22\bin>C:\PROGRA~2\Java\JRE18~1.0_3\bin\java.exe -Dkvem.home=C:\WTK22 -Dja
va.library.path=C:\WTK22/bin -Dsun.java2d.ddlock=true -Dsun.java2d.gdiblit=false
-cp C:\WTK22/wtklib/kenv.zip;C:\WTK22/wtklib/ktools.zip;C:\WTK22/wtklib/customj
mf.jar com.sun.kvem.environment.EmulatorWrapper
Exception in thread "main" java.lang.IllegalStateException: KeepAliveConnection
not initialized
at com.sun.kvem.environment.KeepAliveConnection.run(Unknown Source)
at com.sun.kvem.environment.EmulatorWrapper.main(Unknown Source)

Resources