How can I pass a fail test in Selenium IDE? - selenium-ide

I have a little problem with Selenium IDE. When I open an website and it fails because of timeout, Selenium won't run the next tests where I created a while loop so it will always refresh the webpage if it's not loaded.
My question is, how can make Selenium pass on the next command if the "open" command fails for timeout. Or please suggest any other workaround in case the page is loading continuously .
Thanks, Alex

Related

Stop selenium test execution from eclipse

My scenarios starts to fail, and I have so many scenarios. I need to terminate test execution (I dont want to wait). How I can do that from ECLIPSE?
I am avare of the fact that there is a some button to stop test execution from eclipse. But i do not know how to add it, is it default or I can get it as extension from eclipse market place.
It should be the same as stopping any app in Eclipse. The stop button can be found above the console to the right (Picture below).
However keep in mind that this will then not close the browser driver and you will need to do that manually. Easiest way for me was using the command "taskkill -IM chromedriver.exe -f", chromedriver can only be killed when the force (-f) flag is used. Alternatively you could add some more functionallity to your app to allow you to break within the app that will stop the execution and close the driver.
Stop button

I got an error "[error] Element id=ui-id-7 not found" while running my script using Selenium IDE

[error] Element id=ui-id-7 not found- Selenium IDE - I opened career builder site and started searching for QA Analyst jobs, but while trying to run, i got the error, can somebody help me?
You recorded your script wrong.
After your open url on selenium, add a function called verifyTextPresent and set a value "QA Analyst jbos".
It'll work.

Selenium IDE open command

I am creating automation tests using selenium IDE.
I want to navigate to an url using the open command, And then click on a button on the page , so that I can edit the Record.
After Navigating to the url(hashed url) using the open command.
The Execution stops at this command.
The base url is http://test.com/ and
the url to navigate is http://test.com/#quotes/1
Most probably in the time of the question it touches this problem:
https://code.google.com/p/selenium/issues/detail?id=5165
and there is an workaround:
Command = storeEval
Target = window.location.hash='events/5000/participants/7011'
This would be no solution for current problems with timeout, as Selenium-IDE is already in 2.xx version.

How can I log the failed cases of selenium ide and send them to an email using selenium ide commands

I need a command that helps me to find a solution for the following problem:
logging the failed cases of selenium ide and send them to an email using selenium ide commands.
Thanks.
Omar
Please refer following URL to execute Selenium-IDE HTML Scripts using Selenium RC. Using this you will get HTML result file. To get screenshot you can add captureScreenshot command after failed step.
http://www.softwaretestingdiary.com/2012/02/selenium-core-setup-to-execute-selenium.html

How to run a test in PHPUnit+Selenium?

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...