Automate Selenium Test cases using Windows Service - selenium

I have created a test automation solution using selenium webdriver. Now I want to execute them everyday at particular point of time . For this , I want to create a windows service which starts the tests execution without any input from my side. How should I proceed to achieve that.??
Thanks.

write a batch script that keeps on running and triggers your test everyday at particular time. Or a more professional way is to use Jenkins : )
or you can also use Scheduled Tasks a windows feature
For details on Scheduled tasks

Related

Executing on multiple windows or instances with Selenium web driver

I am trying to build an instagram bot with selenium. So far I have managed to get it work with 1 chrome window and 1 account, it auto follows, likes etc. with the given http requests on my express server. However when I try it with 2 different accounts on 2 different selenium instances or windows, the first one stops executing the function(or maybe it starts executing on the second chrome window, I dont know whats happening). So can anyone explain me if and how its possible to continue execution on multiple windows? Note: I don't want to switch between instances.
You can use the Selenium Grid to implement the scenario.
Generally, Hub & Node Structure is generally used to run parallel Tests.
https://www.guru99.com/introduction-to-selenium-grid.html
Above link will help you to get the concept of Grid.

Automating HPALM Tasks with UFT

I am automating an SAP Application using UFT Tool, I have completed my Automation work in UFT and I have placed all my automation Test Scripts in HP ALM Shared Repository under the folder name Test labs and I am executing my Test scripts from HPALM.
I have a plan to automate the task of launching the HPALM and Run the Test automatically from my local machine so that the user need not need to log into the HPALM each time when he runs a Particular scenario.
In order to achieve this I have an idea to create a file on my local machine containing the name of the test cases and when selecting the Test case the script should open the ALM Connection and Run the Test, But I don't find the appropriate way to achieve this since I am a new to HPALM and VB.
Any Ideas are appreciated and thank you in advance.
Well, in Simpler terms you need to automate using OTA.
1 - You will need a file containing all the test cases and a Flag to check which test case to run - This file can be an Excel file.
2 - Write a VBScript to initiate ALM Connection, Read the cases to be executed from an excel file and execute its test scripts.
Read OTA for more details
Check out my answer for How to use 'Export to HP ALM' Addin for Excel using Macro or VbScript
You may be able to find ideas on connecting ALM through VBScript (I have used a macro, you can use a .VBS (Notepad) )
Let me know if you need more help

Test Automation Framework - Stuck

I am wondering about where to start in building a test framework here.
I create a vb.net application to display the list of projects available. Allow user to select the project, time and date when test needs to get executed.
Once the user decides the time and task, I want my system to schedule a task onto a remote machine where the test execution would happen at the specified time.
I am stuck at point two. any pointers or question is much appreciated.
I use testcomplete for automation.
I want my system to schedule a task onto a remote machine where the test execution would happen at the specified time
There's a Windows Task Scheduler and associated API that supports scheduling tasks at specific times. The API is aimed at C++ programmers.
You could use the Task Scheduler Managed Wrapper available on CodePlex for easy interop with VB.Net.
The task to execute could be copied to a network drive so that it is accessible from the remote machine.
For point 2 you'll have to call TestComplete from the command line as per these instructions:
http://support.smartbear.com/viewarticle/55587/
You can also call TestExecute from the command line, it's a cut down version of Test Complete that will run your tests. Your license may or may not include that.
Did you also consider taking a look at Jenkins for scheduling your test runs?

Running the same junit test case using selenium webdriver in multiple instances of the same browser (load testing)

I'm trying to simulate a firefox load testing situation. I want my to test how 10 simultaneous logins would play out on my system. I already have a connected selenium grid hub and 10 open nodes.
So far, I know I can write the test case and run it 10 times which isn't what I need because it isn't automated. I also know that I can use invocation count on the test to make it run as many times as i want but this only works on the same browser node.
Does anyone have any ideas on how to automatically distribute the same test case to multiple instances of the same driver profile?
i.e. Run a login case test times on the same firefox profile open in 10 different nodes in parallel.
Gracias!
P.S. I built my tests using testNG if that matters.
Basically selenium and testNG is not for such requiurement. You should use some dedicated tool for that like jmeter.
However you can run n methods parrallel let say if you want to login with 10 dif user in 10 thread/browser you can create test data driven and configure to run method in parrallel. Make sure you are providing proper value of parrallel thread count.
How about combining threadpoolsize with invocationcount. - http://testng.org/doc/documentation-main.html#parallel-running
Grid would take care to distribute on the 10 nodes.
use headless browser like GHOST and then invoke multiple threads as ghost has no UI so it would work in your case

Selenium to do automated smoke testing on an interval

I've actually looked through Selenium questions on here and didn't find quite what I was looking for.
Basically I have about 10 "use cases" for smoke testing my site. Basic things such as, can a user log in, can they register etc..
I want to set this up on an interval such as every 10 minutes run these tests.
Is this possible with Selenium Remote Control? Does anyone have a link/tutorial they could point me towards. I'm fairly confident this is possible but I'm just not 100% sure how to get it all set up and running.
Thanks in advance.
Yes this can be done with Selenium RC. I have some Selenium Tutorials on my site. I have set up a basic user experience monitor before using Selenium RC, C#/Nunit and Windows Scheduled tasks to start the job to check the speed of our web app through the day.
Since I recommend using Selenium RC you can use any language you want to write the test.
Dending on what kind of environment you're working with you could use something like JUnit and an automated build system like hudson. This gives you all sorts of notification infrastructure when something goes wrong.
I have known people to run a script like this against both test and production systems (with a fixed user). In test environments you can discover programming mistakes, in production you can assess the up-ness of your system at a far more interesting level than pings or process watching.
Take a look at New Relic's Synthetics product, which wraps Selenium and provides periodic runs with alerting.