I just read that new Watir version (3.1.0) has "support for Alert API". What can I actually do with this API?
Is it meant for dealing with javascript popup windows? If so, what command can I use to click "OK" in popup window? Or how can I read title & text of popup window?
I tried "browser.alert.ok" after updating Watir to 3.1.0 but just got some error message...
(There is not yet any clear documentation about this, and trying to interpret the source code is not my strongest side...)
Alert API is for dealing with JavaScript popups.
browser.alert.ok should work. Could you provide the error message?
I am not sure about getting popup title, but you can get it's text with browser.alert.text
More information: http://watir.github.io/docs/javascript-dialogs/
browser.alert.ok should work. Could you provide the error message?
Sure. First, here is Watir code that I used:
require 'watir'
b = Watir::Browser.start "www.w3schools.com/js/tryit.asp?filename=tryjs_alert"
b.maximize
b.frame(:name, "view").button(:text, "Show alert box").click_no_wait
sleep 2
b.alert.ok
And here is the error message:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/functions.rb:319: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
-- control frame ----------
c:0012 p:---- s:0052 b:0052 l:000051 d:000051 CFUNC :enum_child_windows
c:0011 p:0065 s:0046 b:0046 l:002478 d:002478 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:319
c:0010 p:0015 s:0038 b:0038 l:0018e4 d:0018e4 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:200
c:0009 p:0025 s:0033 b:0033 l:000032 d:000032 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:147
c:0008 p:0035 s:0025 b:0024 l:000023 d:000023 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/window.rb:247
c:0007 p:0017 s:0020 b:0020 l:000019 d:000019 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:220
c:0006 p:---- s:0015 b:0015 l:000014 d:000014 FINISH
c:0005 p:0079 s:0013 b:0013 l:000012 d:000012 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/watir-classic-3.1.0/lib/watir-classic/dialogs/alert.rb:38
c:0004 p:0011 s:0010 b:0010 l:000009 d:000009 METHOD C:/Ruby192/lib/ruby/gems/1.
9.1/gems/watir-classic-3.1.0/lib/watir-classic/dialogs/alert.rb:27
c:0003 p:0107 s:0007 b:0007 l:00043c d:0018c0 EVAL C:/watir_testit/pop.rb:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00043c d:00043c TOP
-- Ruby level backtrace information ----------------------------------------
C:/watir_testit/pop.rb:6:in <main>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/dialog
s/alert.rb:27:inok'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/dialog
s/alert.rb:38:in dialog'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:
220:inmethod_missing'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/window.rb:247:in child'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/functions.rb:147:inchild_window_locators'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/functions.rb:200:in control_hwnd'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/functions.rb:319:infind_hwnd'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/wi
n_32/functions.rb:319:in `enum_child_windows'
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Related
when creating new theme there's error occurred.
0 - Communication Failure
Why this happen? could you please help me?
This usually happens due to a timeout that occurs when the Theme-controller tries to read the Theme's configuration for the first time. Unfortunately, this is quite a resource-heavy process; on weaker servers, timeouts may occur during this process quite often.
You can confirm this by opening the Theme-Manager, opening your browser's developer tools, refreshing the Theme overview and look at the response of the backend/Themes/list-Request.
You can give your server more time with the php-function set_time_limit. In engine/Shopware/Components/Theme/Installer.php, in the synchronize-method, prepend set_time_limit(0):
public function synchronize()
{
set_time_limit(0);
$this->synchronizeThemes();
}
Alternatively, prepend set_time_limit(0); to your shopware.php file, but don't forget to remove it again once the theme-overview loaded successfully.
I now went to put this code check SO into another app and I am getting an error on the line:
if ((self = originalImp(self, _cmd, cf))) {
The build error is:
"Too many arguments to function call, expected 0, have 3"
I am using Xcode 6.2 compiling for iOS 7.1
Thanks
K
You can Disable the check in the Project Build Settings by setting 'Enable strict checking of objc_msgSend Calls' to No.
Has worked for me in similar situations. Filter the Build Settings on the keyword 'strict' to find it easily.
I've written a ruby script to test my application. Sometimes it seems to be executing without any error. When executing the same code next time however, the execution is not working as expected and it throws an error. Why it is behaving like this?
The error:
[remote server] file:///C:/Users/RAGHUN~1/AppData/Local/Temp/webdriver-profile20140818-5504-b2tdgg/extensions/fxdriver#googlecode.com/components/driver_componen
t.js:9470:133:in `FirefoxDriver.prototype.findElementInternal_': Unable to locat
e element: {"method":"tag name","selector":"body"} (Selenium::WebDriver::Error::
NoSuchElementError)
Also to overcome this issue tried Watir::always_locate = true but this is also not working. Am I missing any gem files? Can any one provide a suggestion?
Based on the "unable to locate element" error you're experiencing, if you're using Watir to manipulate the elements then I'd try applying ".wait_until_present" or ".when_present" to see if it's a case of that step in question executing too quickly. Hope that helps! Let us know!
Watir::always_locate = true
profile = Selenium::WebDriver::Firefox::Profile.new
profile.native_events = false
b=Watir::Browser.new:firefox, :profile => profile
This works for me
I am using Flash builder actionscript 3 Flex mobile.
I have a very heavy function that loads data from the local device and creates many graphic elements. While this function runs, the device freezes for 6 seconds or so.
I want to show a progress bar and let the device continue working, is there any way I can use threading to do this ? Other ideas are also welcome.
Thanks, Koby.
You know that at which function application getting freeze. Before that function call a progress bar. Create a progress bar in a pop up mode & call it. After 6 seconds(Not recommended) or getting the data just call removeallpopups() method. So now you can set the label in progress bar as "Loding..."
Sample code
<mx:ProgressBar id="sampleProgressBar" styleName="Calib16Blue"
indeterminate="true" labelPlacement="left"
label="{theMessage}"/>
Call this mxml by creating a pop up.
To do 'proper' muiltithreading you need to use the Worker Class (Documentation here), however the SQLConnection class and FileStream class have asynchronous methods that fit into the normal Actionscript event listener cycle and operate in "the background". Allowing the rest of the app to load when they're still pending.
I am getting the following errors in SystemOut logs:
[11/4/11 2:53:13:876 ZZZ] 00000245 srt W
com.ibm.ws.webcontainer.srt.SRTServletResponse setStatus WARNING:
Cannot set status. Response already committed.
[11/4/11 2:53:13:876 ZZZ] 00000245 srt W
com.ibm.ws.webcontainer.srt.SRTServletResponse addHeader WARNING:
Cannot set header. Response already committed.
A bit of searching got me here: http://www-01.ibm.com/support/docview.wss?uid=swg21316420
The solution talked about here says that we should disable "Cookie Acceptance test". But i am not able to find out where exactly is that checkbox in admin console.
The technote you are referring to is for a specific application (WebSphere Commerce). If you are getting these warnings with your own application, then the technote doesn't apply. What these warnings mean is that you have a JSP or servlet that calls setStatus or addHeader after too much output has already been written to the response. You need to determine where this happens and either fix your code or increase the output buffer size.