I have been doing automation testing and it is working fine. It is working like open a browser, interact with elements and execute test cases based on given conditions.
I am using Selenium Webdriver, TestNG, Java and Maven for this.
Now from seniorI got request that we perform same test cases without open browser or interact with UI. How it is possible in selenium webdriver?
They said they will provide me API, It is possible to do same using API. If yes then kindly provide a small example so that I can know more about it and will implement then.
I have tried PhantomJS, HtmlUnitDriver but all have their disadvantage. I think Xvfv is the better solution, no need to change code just run your script heedlessly.
Install Xvfb
sudo apt-get install xvfb
And use this command to run mvn script heedlessly
xvfb-run --server-args="-screen 0, 1624x1068x24" mvn test
I hope it will help you.
Related
We are trying to developer an automation test, and we found Selenide an interesting and easy framework for running the UI tests.
Selenide needs as an input the browser to use.
So we are passing 2 arguments to the program:
selenide.browser=Chrome
webdriver.chrome.driver=C:\\chromedriver_win32\\chromedriver.exe
And the code looks something like that:
System.setProperty("webdriver.chrome.driver",inputParams.get("webdriver.chrome.driver"));
System.setProperty("selenide.browser", inputParams.get("selenide.browser"));
open("http://v3is245.prod.leadspace.com:20400/ui/jobs");
All works fine, but we also need it to run in headless mode.
We tried several ways to run it in headless mode, (different param in the selenide.browser, PhantomJs and some other combinations, but with not success till now.
It turned out that in order to run Selenide in headless mode we need to add system property selenide.headless=true
You could do also:
Configuration.headless = true;
We have a requirement to run selenium script recorded in fire fox plugin via tool which can run these scripts and give logs on a web console. Does anyone know of such a tool?
Requirement is that QA guy records a bunch of test cases and then some non tech person can simply come in and run these and see verbose output.
Have a look at the following plugin for Selenium-IDE to save log to a file.
https://addons.mozilla.org/nl/firefox/addon/file-logging-selenium-ide/
if you are looking for record playback too, this would be a better option.
https://addons.mozilla.org/en-US/firefox/addon/imacros-for-firefox/
They have plugin for chrome as well, so hopefully you can use run the same recorded scripts in chrome browser as well.
I'm writing Selenium tests using Java + Maven + Selenium WebDriver. Our customer wants these tests in such a way that they can run tests easily without much technical stuff needed.
I've all my tests under src\test\java folder. Is there any way where I can give jar file or so to the customer and they can run tests by simply clicking on it or by hitting some command on the command line.
Please point me to documentation or video using which I can achieve this.
I've been using Visual Studio to write my Selenium tests in C#. I am able to build my project to a console application in Visual Studio that contains the required files like the Chrome webdriver. It can be run from this single application file with one click. The console then prints out if the test is a success or if their are any exceptions. You should also be able to integrate a headless browser like selenium has on their site. This would allow the test to be run with one click and no browser will pop up while the tests are running.This is all the experience I have and it has worked well for me. Hope that this information can help a little.
I have created a set of test cases using Firefox Driver in Eclipse IDE.
But now I need these test cases to run without opening the browser window. How can I achieve that?
Presently I am using Firefox Driver Web Driver that runs in Firefox Browser.
Can some one help me with an example?
If you do not need to think about compatibility of different web browser, you could try Celerity. It could be run automated test script without any browser window.
http://celerity.rubyforge.org/
It is based on JRuby, and is very easy to learn and use.
I am working in selenium RC with Java+Junit+Eclipse.
For my project I have developed script which will run in only one browser i.e Firefox through the below code..
public void setUp() throws Exception
{
selenium = new DefaultSelenium("localhost", 4444,"*firefox","http://www.google.com");
FinalTestSuite.selenium.start();
selenium.windowFocus();
selenium.windowMaximize();
}
Now I am stuck because requirement came to run the script simultaneously in multiple browsers.
I didn't find any helpful article..
Please anyone working on this same scenario...HELP! :)
You can use Selenium Grid to run a script in multiple browsers. Also you can refer this blog regarding its setup configuration.
Hope this helps.
Create a runner which will run the suite containing setUp()
Pass the browser name by variable to setup.
You can run the code multiple times with multiple RC server started on different ports.
e.g. My projects runs through ant so i pass -Dargument=*firefox on command prompt then my test cases run on firefox browser also you can pass the port number and host ip.
Thanks
The best thing to use for parallel execution is TestNG. But since you are using Junit , the following link may help you in that.
http://blog.varunin.com/2011/07/running-selenium-tests-on-different.html