I am trying to export a Test Case in Selenium IDE (in JUnit format), but everytime I am getting the same error:Test '001_PROVISIONALQC2657CONGCSourceCP400600HFA' has a problem: Invalid command ''
Even if I set all the lines inside the script as comments I am still unable to export it.
The problem occured because of the comments added to the script, and also because of a Close command for the URL that was opened on the first place. After removing these lines the export took place successfully.
Save project and reopen. This did the trick.
Related
I have a java selenium QA project where we use ant and testng via the powershell terminal. What I would like help with is creating a redirect if a tester enters a typo in the terminal.
If I am in the run directory and I simply type ant, it will run the default.xml file listed in the build.xml file which is what I expect.
If I enter an actual ant command with a typo though:
ant -Dtestdir= c:\dev\qa\src\tests -Dtestxml=blablabla
it will attempt to run every test.xml file in the test directory. This is especially problematic because most of the those test.xml files call java classes that contain #Factory and #Dataprovider(s) and they allocate everything at once which just causes everything to fail.
What I would like is a way to tell ant if the input is erroneous, then run the default.xml file(which I have configured to populate an html error page). I've been reviewing both testng and ant docs and I'm not finding a solution, so your guidance would be appreciated.
Other than this one issue, the system works very well.
After digging around a bit more and learning how to ask the question properly, I found 2 great examples here on SO.
1) Create an additional ant target that checks for the existence of the file the user has typed. And add it to the depends attribute of the main target , and also adding the if attribute.
Example
2) Use the Ant fail task and fail the build (with a message) if the file is not available. I prefer this one because the tester can get some feedback.
Example 2
I have everything installed and I am able to create and run tests in NetBeans fine by right clicking the test in the project menu and selecting "Run". The problem is that the browser windows opened for the test close immediately after the test is ran - meaning that the only reporting I have is what NetBeans provides and that's not enough. I don't think I want to use the command line, plus I haven't had much success with it in the past anyways.
Is it possible to just point the browser at the test.php file? When i try to do that I get this error:
Fatal error: Class 'PHPUnit_Framework_TestCase' not found in C:\xampp\php\PEAR\PHPUnit\Extensions\SeleniumTestCase.php on line 275
Shouldn't i be able to execute these test from a different machine? ie PC1 is my dedicated selenium test box and I want to tell it to run test.php from PC2 remotely.
Where should my test files go?
How do I customize the reporting/out put from the test script?
You could add a sleep(60) at the end of your test :) This would prevent PHPUnit from closing the Selenium session.
Alternatively, store your selenium tests as html files compatible with the Selenium IDE Firefox extension and let the test simply run in your browser.
I found out how to run my test files remotely - i just created a script that would execute phpunit from the command line:
<?php
exec('c:\xampp\php\phpunit.bat c:\xampp\htdocs\selenium\testcases\newSeleneseTest.php', $output);
echo "<pre>". var_export($output,TRUE)."</pre>";
exec('c:\xampp\php\phpunit.bat c:\xampp\htdocs\selenium\testcases\newSeleneseTest.php', $output);
echo "<pre>". var_export($output,TRUE)."</pre>";
?>
then I can just hit the URL of that script to have it run - works great, but I still think there should be a better/easier way...
In order to fix another problem (Stackoverflow Question 6367763) I needed to modify the startGrails script. I made the necessary updates however the modifications are not being picked up when I run Grails commands from within Eclipse/STS.
I put debug in the script and know it is functioning correctly when I call it directly from the command line. However STS appears to be running the original version.
Does STS have another copy of the startGrails script? How can I update this one or ensure STS links to the version of the startGrails script that I updated?
I'm trying to fix a build file where a part of it runs a bash script to generate a file. This file generation takes under a second and wasn't a problem until we moved to eclipse.
The issue is that if I save any file in eclipse with a change and then run ant to build. I get a "class not found" error on the generated file. Seems like eclipse is doing something to the newly generated file (it even shows it with an error check box)
If I wait a few seconds more and run the build again, it works fine.
What I have been trying to use is this.
<waitfor maxwait="30" maxwaitunit="second">
<available file="${src}/thefile.java"/>
</waitfor>
It does not work. I also tried to look at something called <readable> under the selectors set which by the documentation could be used in junction with some other waitfor methods.
How can I fix this problem or is there another way around it?
Found the issue. Eclipse was locking the generated file while it was building the workspace so the bash script that generated it would mess up.
The building of the workspace took 4-5 seconds so that was the delay.
I was able to speed up the building of the workspace by disabling the XML and DTD validation. (Window > Preferences > Validation)
Related to another question, we want to change the eclipse run command.
I found that eclipse can run executing the script:
/usr/qnx630/host/qnx6/x86/usr/bin/qde.sh
But the startup configuration is not written there. The only thing the script does is executing the file:
/usr/qnx630/host/qnx6/x86/usr/qde/eclipse/eclipse
This file is a binary which ends calling another one with all the startup parameters for Eclipse.
So my question is: where can I find and change those parameters?
Thank you for your time.
I would first look at the eclipse.ini file to check if your startup configuration is not better expressed there.
(that is one element for having a quicker eclipse)
In your case, it should be at:
/usr/qnx630/host/qnx6/x86/usr/qde/eclipse/eclipse.ini
If it is not there, you could create it. It would be detected by eclipse during launch.