I am trying to run a recorded test case in Selenium IDE. The problem is that when I try to execute the whole test case, Selenium stops it not finding an element on page. The problem is that I can execute single steps of the test case. I thought that Selenium tries to find an element before loading a new page, so I used clickAndWait, pause and waitForElementPresent commands - nothing works, Selenium stops the test case.
debug log
• [info] Executing: |`clickAndWait` | css=i.fa.fa-arrow-left | |
• [debug] Command found, going to execute clickAndWait
• [debug] modifyWindow seleniumMarker1429084950752:selenium1429084951105
• [debug] _getFrameElement: frameElement=null
• [debug] modifySeparateTestWindowToDetectPageLoads: already polling this window: selenium1429084951105
• [debug] getCurrentWindow newPageLoaded = false
• [error] Element css=i.fa.fa-arrow-left not found
• [debug] commandError
• [debug] testComplete: failed=true
• [info] Test case failed
I will be very grateful for any help and suggestions.
There are certain cases where 'ClickAndWait' is not reliable and won't wait for the command to finish before moving to the next command. In such cases, an alternative is to use 'Click' instead and follow it up with a 'waitForPageToLoad'.
Example...
ORIGINAL
<tr>
<td>clickAndWait</td>
<td>//input[#type='submit']</td>
<td></td>
</tr>
NEW
<tr>
<td>click</td>
<td>//input[#type='submit']</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td>10000</td>
<td></td>
</tr>
If this doesn't help, please post your source code and I'll see if there's something else I can suggest.
I have found much success with this issue (elements not being present yet) by using a combination of waitForElementPresent, verifyElementPresent, and installing the Implicit Wait plugin for the IDE. (https://addons.mozilla.org/en-US/firefox/addon/selenium-ide-implicit-wait/). I have now almost completely been able to remove all "pause" commands from my tests.
Klendathu
Related
I'm working on a Scala project in IntelliJ. I'm trying to use Predef.assert.
Given the following code :
test("TEST"){
try{
Predef.assert(0 == 1,"test")
}
catch{
case e :AssertionError => println("Catch")
}
println("End")
}
I create a configuration in IntelliJ with the VM option : -ea
I expect to have Catchand Endwritten in the console, but it outputs only End
The assertion is ignored, even if I enable it in the VM options of the current configuration of IntelliJ. Is there anyone who has experienced this ?
I can even see in the IntelliJ console that the parameter has been added :
"C:\Program Files\Java\jdk1.8.0_144\bin\java.exe" -ea "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.1.5\lib ...
How do I enable the assertions properly ?
Instead of starting IntelliJ itself with the VM option, you have to configure it to run your program with the appropriate options.
Open the run configuration of your project and add the options as shown in the following Screenshots:
Okay, after being confronted to the fact that it works with a new project (only myself to blame here, always start from scratch, as per MCVE) I started digging, and the fact is, a parameter was still laying in the file .idea/scala_compiler
I had to remove
<parameter value="-Xdisable-assertions" />
Which obviously overtook the VM parameters.
I am using eclipse to develop a gwt application and recently I migrated from GWT 2.6.0 to 2.7.0. I was always using super dev mode(with built-in jetty) and it worked ok with 2.6. While using superdev mode on 2.7 it has become quite frequent for the linker to not detect the cache.js.gz and it seems like this causes gwt to generate an insane amount of recompiles with a simple refresh(pressing F5 on firefox).
Recently I cleared my Temp folder with ccleaner and I am not sure if this affected the files used for the jetty codeserver. Though normally every time you run a gwt app it generates all the necessary files in the Temp/ folder.
Here is a sample log:
>Super Dev Mode starting up
> workDir: C:\Users\Georgios\AppData\Local\Temp\gwt-codeserver-8575962486520173754.tmp
>GET /recompile/aanwebappv1
>Job com.aan.main.AanWebAppV1_1_9
>starting job: com.aan.main.AanWebAppV1_1_1
>binding: user.agent=gecko1_8
>skipped compile because no input files have changed
0.091s total -- Compile completed
>GET /aanwebappv1/164467EFAF74C025EFC82CAB8189FED3.cache.js
> Sent error page: not found: C:\Users\Georgios\AppData\Local\Temp\gwt-codeserver-8575962486520173754.tmp\com.aan.main.AanWebAppV1\compile-2\war\aanwebappv1\164467EFAF74C025EFC82CAB8189FED3.cache.js.gz
>starting job: com.aan.main.AanWebAppV1_1_5
>GET /recompile/aanwebappv1
>Job com.aan.main.AanWebAppV1_1_10
binding: user.agent=gecko1_8
skipped compile because no input files have changed
> 0.081s total -- Compile completed
> starting job: com.aan.main.AanWebAppV1_1_6
>GET /aanwebappv1/4D923033DA748FA380787E84FE5C58B9.cache.js
>Sent error page: not found: C:\Users\Georgios\AppData\Local\Temp\gwt-codeserver-8575962486520173754.tmp\com.aan.main.AanWebAppV1\compile-2\war\aanwebappv1\4D923033DA748FA380787E84FE5C58B9.cache.js.gz
This [GET/recompile-starting job-Sent error page: not found:] cycle goes on and on generating 30-40 compiles or even more slowing the debugging process greatly...It even happens on the first compile sometimes..Any thoughts-ideas how to fix this?
I've tried everything, but cannot seem to get it working. I've done the following:
1.Remove the plugins with the variables via the config designer.
2.Update to Cordova 5.0.0 via the config designer (Platforms > Cordova CLI)
3.From the command line: 1.Go to your project directory.
2.Type the following substituting the plugin name for the plugin you wish to add:
3.npm install -g cordova
4.cordova plugin add nl.x-services.plugins.launchmyapp --variable URL_SCHEME=myscheme
But I still cannot build. Here is the detailed output from MSBUILD :
http://pastebin.com/7enSzCxs
And a highlight of some of the errors I'm getting
1> BUILD FAILED
1> C:\Users\Adam\AppData\Local\Android\android-sdk\tools\ant\build.xml:601: The following error occurred while executing this line:
1> F:\GIT\CordovaFb\BlankCordovaApp1\fbtest\platforms\android\com.phonegap.plugins.facebookconnect\myapp2568ddfac877478fb806edc911cff37e-FacebookLib\custom_rules.xml:4: F:\GIT\CordovaFb\BlankCordovaApp1\fbtest\platforms\android\com.phonegap.plugins.facebookconnect\myapp2568ddfac877478fb806edc911cff37e-FacebookLib\ant-build does not exist.
And
1> BUILD FAILED
1> C:\Users\Adam\AppData\Local\Android\android-sdk\tools\ant\build.xml:470: The following error occurred while executing this line:
1> C:\Users\Adam\AppData\Local\Android\android-sdk\tools\ant\build.xml:441: Unable to delete directory F:\GIT\CordovaFb\BlankCordovaApp1\fbtest\platforms\android\com.phonegap.plugins.facebookconnect\myapp2568ddfac877478fb806edc911cff37e-FacebookLib\bin
And finally
1>
1> F:\GIT\CordovaFb\BlankCordovaApp1\fbtest\platforms\android\cordova\node_modules\q\q.js:126
1> throw e;
1> ^
1> Error code 1 for command: cmd with args: /s /c "ant debug -f F:\GIT\CordovaFb\BlankCordovaApp1\fbtest\platforms\android\build.xml"
1> Command finished with error code 8: F:\GIT\CordovaFb\BlankCordovaApp1\fbtest\platforms\android\cordova\build.bat --debug,--ant,
1>MDAVSCLI : error : F:\GIT\CordovaFb\BlankCordovaApp1\fbtest\platforms\android\cordova\build.bat: Command failed with exit code 8
1>Done executing task "MdaVsCli" -- FAILED.
1>Done building target "BuildMDA" in project "fbtest.jsproj" -- FAILED.
1>Build FAILED.
Any ideas at all? Using a fresh install of VS2015 with the tools for cordova, trying to build for android.
EDIT:
So after taking the advice of Kamil Pajdzik below, I used build.bat to compile it and found some issues with my path being waaay to long. I mapped a drive to cut down the length and it will now build AOK from the build.bat.
Still no dice in Visual studio though (I assume this is difference between build.bat using gradle and vs using ant).
My only error now is :
1> -code-gen:
1> [mergemanifest] Merging AndroidManifest files into one.
1> [mergemanifest] Manifest merger disabled. Using project manifest only.
1> [echo] Handling aidl files...
1> [aidl] No AIDL files to compile.
1> [echo] ----------
1> [echo] Handling RenderScript files...
1> [echo] ----------
1> [echo] Handling Resources...
1> [aapt] Generating resource IDs...
1> [aapt] Z:\fbtest\platforms\android\bin\AndroidManifest.xml:14: error: Error: No resource found that matches the given name (at 'value' with value '#string/fb_app_id').
1> [aapt]
1> [aapt] Z:\fbtest\platforms\android\bin\AndroidManifest.xml:15: error: Error: No resource found that matches the given name (at 'label' with value '#string/fb_app_name').
1> [aapt]
1>
1> BUILD FAILED
1> C:\Users\Adam\AppData\Local\Android\android-sdk\tools\ant\build.xml:653: The following error occurred while executing this line:
1> C:\Users\Adam\AppData\Local\Android\android-sdk\tools\ant\build.xml:698: null returned: 1
1>
Okay, this appears to be the issue. There are two problems. The first is a max path size issue on Windows. The issue is that it the plugin uses part of the the app's ID to create a folder, and VS by default uses a random identifier that is fairly long so this exacerbates the issue.
To resolve:
Update the ID for your project to something short (com.myproject.short)
Move the project to the root of your drive
Go to the project folder and re-add the android platform. From the command line:
cordova platform remove android
cordova platform add android
The second issue that then remains is an "Ant" build seems to be missing a folder which likely is a bug. If you add the "ant-build" folder in the location it complains about the build succeeds.
Also - Be sure plugins/fetch.json is included in your checkins since this is where your plugin variables are stored. If that file is deleted, you'll need to remove and re-add the plugin again. From your update it sounds like either VS is still set to use Cordova 4.3.0 and/or plugins/fetch.json does not contain your plugin variables. You should see something like this if the plugin was added using Cordova 5.0.0:
{
"com.phonegap.plugins.facebookconnect": {
"source": {
"type": "registry",
"id": "com.phonegap.plugins.facebookconnect"
},
"is_top_level": true,
"variables": {
"APP_ID": "123",
"APP_NAME": "nbaer"
}
}
}
The "variables" section is what may be missing.
Try running F:\GIT\CordovaFb\BlankCordovaApp1\fbtest\platforms\android\cordova\build.bat from a command line. It usually gives more information.
Cordova 5.0.0 requires Android SDK in version 22. You can check if you have that installed via SDK manager.
This particular plugin appears to have some challenges with Cordova 5.0.0. Android underwent significant changes in this release that may be causing issues.
https://github.com/Wizcorp/phonegap-facebook-plugin/issues/1010
I am seeing failures if you build either with Ant or Gradle using a pure Cordova command line interface project. Likely a plugin fix is required to resolve the issue. I reccomend adding comments to this defect to help the plugin author resolve the issue.
So thanks to Chucks help, I managed to get a build working. It was indeed a combination of path length exceeding 260 characters (which I solved by mapping my solution directory to a drive) and a couple of folders not being created.
They were in my case :
F:\Git\CordovaFb\FBTest\platforms\android\com.phonegap.plugins.facebookconnect\myapp7a29c6c80cee4b2aa0dc8a70dc57527d-FacebookLib\bin\classes
and
F:\Git\CordovaFb\FBTest\platforms\android\com.phonegap.plugins.facebookconnect\myapp7a29c6c80cee4b2aa0dc8a70dc57527d-FacebookLib\ant-build
I seem to have to manually recreate these from time to time as they get deleted on some builds...
So the full process is as follows (for others who have the same issue)
1) Create your solution in as short a path as possible (map a drive if you need to)
2) Add your cordova project to the solution, double click config.xml, goto platforms and change the CLI version to 5.0.0
3) Fire up a command prompt in the solutions root
4) Type the following cordova plugin add https://github.com/Wizcorp/phonegap-facebook-plugin.git --variable APP_ID="00000000" --variable APP_NAME="My App"
5) When its done you'll have the plugin in the plugins dir and the fetch.json file should contain the variables you entered for appid and appname
6) Do a full build and you'll get some errors (Exit code 8)
7) Manually create the following :
[Solution Route]\platforms\android\com.phonegap.plugins.facebookconnect\myapp7a29c6c80cee4b2aa0dc8a70dc57527d-FacebookLib\bin\classes`
and
[Solution Route]\platforms\android\com.phonegap.plugins.facebookconnect\myapp7a29c6c80cee4b2aa0dc8a70dc57527d-FacebookLib\bin\classes`
8) Your build should succeed! Check periodically if those paths still exist.
This should get you by until the next release of the cordova tools for VS (if they fix it)
platforms\android\AndroidManifest.xml
just change android:minSdkVersion="14" to android:minSdkVersion="15"
Recently upgraded from SonarQube 4.2 to SonarQube 4.3.
In the UI:
Get "We're sorry, but something went wrong." Clicked on "Go back to the homepage" and the following message is included towards the top of the page:
Only offset must be set on DebtRemediationFunction{type=CONSTANT_ISSUE, coefficient=1h, offset=}
In sonar.log:
2014.05.09 17:07:25 ERROR [o.s.s.ui.JRubyFacade] Fail to render: http://our-server.example/rules_configuration/index/9
undefined method `inject' for nil:NilClass
On line #52 of app/views/rules_configuration/index.html.erb
49: </div>
50: <div class="rule-search top">
51: <span class="note"><%= message('rules_configuration.repository') -%></span><br/>
52: <%= dropdown_tag "repositories", options_for_select(#select_repositories, #repositories), {
53: :show_search_box => true,
54: :width => '120px',
55: :placeholder => message('any')
gems/gems/actionpack-2.3.15/lib/action_view/helpers/form_options_helper.rb:292:in `options_for_select'
app/views/rules_configuration/index.html.erb:52:in `block_called_from_erb?'
org/jruby/RubyProc.java:290:in `call'
org/jruby/RubyProc.java:224:in `call'
gems/gems/actionpack-2.3.15/lib/action_view/helpers/capture_helper.rb:36:in `capture'
Updated with plugins and versions 5/13/2014
Plugins & Versions:
Build Breaker [buildbreaker] 1.1
Checkstyle [checkstyle] 2.1
Issues Report [issuesreport] 1.2.1
Java [java] 2.2
PMD [pmd] 2.1
Useless Code Tracker [uselesscodetracker] 1.0
Any ideas?
A JIRA ticket has been created to fix this issue : https://jira.codehaus.org/browse/SONAR-5335
You'll have to follow steps described in the description to manually fix it.
I have exactly the same issue. Seems like the only way is to rollback to 4.2, but it's only possible if you have DB backup.
Update: possible workaround
It seems to be a PMD plugin related issue. I found the following workaround:
Save a backup of your quality profile
Change the name in saved xml to prevent collision
Restore the profile from the saved xml
Use new profile instead of the original
You may notice that the number of active rules in a new profile is a bit decreased.
I'm trying to deploy a JavaFX app. The app I've been working on is fairly complex and includes several libraries. When I create a jnlp and try to run it I always get a "Runtime error. Click for details" message. Someone suggested I try doing just a simple Hello World app to see if it's an issue with the included libraries. I tried that and I still get the "Runtime error."
Here's the build.xml I'm trying to use.
<project name="App" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="C:\Program Files\Java\jdk7\lib\ant-javafx.jar" />
<target name="default">
<fx:deploy width="600" height="400" outdir="${basedir}/dist" outfile="App">
<fx:application name="App" mainClass="${javafx.main.class}"/>
<fx:resources>
<!-- include application jars -->
<fx:fileset dir="${basedir}" includes="*.jar"/>
<fx:fileset dir="${basedir}/lib" includes="*.jar"/>
<fx:fileset dir="${basedir}" includes="app.ini" />
<fx:fileset dir="${basedir}/template" includes="*.template" />
</fx:resources>
<!-- request user level installation -->
<fx:preferences install="false"/>
</fx:deploy>
</target>
</project>
For the Hello World version I just removed the <fx:resources> section.
I run both of them from inside eclipse as an ant task. They both created a dist folder in my project with a .jnlp and a .html file. I then click on the jnlp to run the app and see a small window that has the text, "Runtime error. Click for details.' I click it and get an error window that says, "The application failed to run. There was an error while executing the application. Click 'Details' for more information." I click the 'Details' button and see a Java Console with the following information (HelloWorld version):
Java Plug-in 10.7.2.11
Using JRE version 1.7.0_07-b11 Java HotSpot(TM) 64-Bit Server VM
User home directory = C:\Users\user
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
Match: beginTraversal
Match: digest selected JREDesc: JREDesc[version 1.6+, heap=-1--1, args=null, href=http://java.sun.com/products/autodl/j2se, sel=false, null, null], JREInfo: JREInfo for index 0:
platform is: 1.7
product is: 1.7.0_07
location is: http://java.sun.com/products/autodl/j2se
path is: C:\Program Files\Java\jre7\bin\javaw.exe
args is: null
native platform is: Windows, amd64 [ x86_64, 64bit ]
JavaFX runtime is: JavaFX 2.2.1 found at C:\Program Files\Java\jre7\
enabled is: true
registered is: true
system is: true
Match: ignoring maxHeap: -1
Match: ignoring InitHeap: -1
Match: digesting vmargs: null
Match: digested vmargs: [JVMParameters: isSecure: true, args: ]
Match: JVM args after accumulation: [JVMParameters: isSecure: true, args: ]
Match: digest LaunchDesc: file:/G:/workspaces/JavaProjects/JavaFXHelloWorld/dist/HelloWorld.jnlp
Match: digest properties: []
Match: JVM args: [JVMParameters: isSecure: true, args: ]
Match: endTraversal ..
Match: JVM args final:
Match: Running JREInfo Version match: 1.7.0.07 == 1.7.0.07
Match: Running JVM args match: have:<> satisfy want:<>
CacheEntry[file:/G:/workspaces/JavaProjects/JavaFXHelloWorld/dist/HelloWorld.jnlp]: updateAvailable=false,lastModified=Fri Sep 14 07:13:28 MDT 2012,length=915
I get a nearly identical error when I run the app I'm working on.
I just uninstalled java and then reinstalled the latest SDK. That didn't do anything except may the app use the 64 bit JVM instead of a 32 bit JVM I had installed. The error message stayed the same.
Does anyone know what I'm doing wrong? Is my build script incorrect? Is there a better way to deploy? I don't have to have a jnlp so I'm open to any deploy method. I just need something I can run on a windows machine and possibly a mac.
I've tried googling my problem and I've searched StackOverflow and can't seem to find anything relevent. I might just be using the wrong search terms.
Any help would be greatly appreciated.
Thanks,
Hardy
If you are using netbeans then Right Click on the Project and Go to Project Properties then to Libraries then click on Manage Platform then select the Default Javafx platform then go to JAVAFX tab and then change the JAVAFX SDK location to where your Java fx 2 sdk is and also similarly change the JAVAFX JRE. Hope this will solve your Problem.
I eventually found out that, in my case, this issue was caused by a bug in the jar signing process. The problem is avoided by emptying the Java cache (on Windows, this can be done through the Java control panel). After doing so and rebuilding, the error no longer occurred in my case.
I'm unsure this will fix your problem, though, as you do not appear to do any signing.