Wednesday 17 June 2015

Selenium grid(Practically worked) Notes.

Selenium GRID:
It is nothing but executing the test scripts remotly on other computers which is in other words called as nodes.

Selenium grid mainly consists of 3 parts.
1) HUB
2) NODES
3) Script Runner.

--> HUB:
              Hub acts like a master which intern takes the control of all the nodes.

--> NODES:
              Node is an another computer which is otherwise called as slaves. This nodes will take in the request which ever sent by the hub and processes it.

--> Script Runner:
              Script Runner is also a computer where we will run our WebDriver(JAVA) code. The script runner will send a request to hub for the execution of a perticular script. The hub will redirect the request sent by the script runner to the respectiive nodes. The nodes will automate the respective test script which ever sent by the script runner.


HOW TO MAKE A COMPUTER ACT AS A HUB??

Goto command prompt --> Type the following command

java -jar "path of the selenium RC JAR" -role hub -port 1111

HOW TO MAKE OTHER COMPUTER ACT AS A NODE??

goto command prompt--> type the following,

java -Dwebdriver.chrome.driver="path of chromeDriver.exe file" -Dwebdriver.ie.driver="path of IEDriver.exe file" -jar "path of Selenium RC JAR file" -role node -hub http://<IP ADDRESS OF HUB COMPUTER>:PORT NUMBER(1111)/grid/register -browser browserName="chrome" -browser browserName="internet explorer" -port 5511

NOTE: We can type the above command in multiple computer. For example you have 3 computers and you want to make that 3 computers to act like nodes. Type the above command on all the 3 computers.

HOW TO WRITE THE TEST SCRIPT??



HOW TO OPEN DIFFERENT BROWSERS ON DIFFERENT NODES:

This can be done by using .XML file.. And including <parameter> tag

Thursday 11 June 2015

Working with multiple submenu in selenium webdriver on amazon.in

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;


public class amazon {

public static void main(String[] args) {
WebDriver driver;
String url;

driver = new FirefoxDriver();
driver.manage().window().maximize();
url ="http://www.amazon.in";
driver.get(url);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
Actions act = new Actions(driver);

WebElement wele = driver.findElement(By.xpath("//a[@id='nav-link-shopall']"));
act.moveToElement(wele).perform();

WebElement wele1 = driver.findElement(By.xpath("//div[@id='nav-flyout-shopAll']/div/span/span[text()='Car & Motorbike']"));
act.moveToElement(wele1).perform();

WebElement wele2 = driver.findElement(By.xpath("//div[@id='nav-flyout-shopAll']/div/div/div/a/span[text()='All Car & Motorbike']"));
act.moveToElement(wele2).click().perform();
}

}

DragAndDropFunctionality using webdriver.

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;


public class DragAndDropDemo {

public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://dhtmlgoodies.com/submitted-scripts/i-google-like-drag-drop/");

driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

WebElement source = driver.findElement(By.xpath("//div[@id='block-1']/h1"));
WebElement destination = driver.findElement(By.xpath("//div[@id='column-2']"));

Actions act = new Actions(driver);
act.dragAndDrop(source, destination).perform();
}

}

Tuesday 2 June 2015

ActiTIME: First 50 manual scenario's.

[Users module]     [DONE]
Scenario 1:
1.      Login as admin
2.      Click on create new user
3.      Enter the required data in required field. Write user name as manager
4.      Enter the required user information.
5.      Set the password for manager
6.      Logout from admin
Expected Result: Manager should be in user list
[Users module]   [DONE]
Scenario 2:
1.      Login as admin
2.      Click on create new user
3.      Enter the required data in required field. Write user name as manager
4.      Enter the required user information.
5.      Set the password for manager
6.      Logout  as admin
7.      Login as manager
Expected result: Manager home page should be displayed
[Users module] [DONE]
Scenario 3:
1.      Login as admin
2.      Click on create new user
3.      Enter the required data in required field. Write user name as manager
4.      Enter the required user information.
5.      Set the password for manager
6.      Disable manager’s access to his account.
7.      Logout from admin.
8.      Login as manager
Expected Result: The manager’s account should not open. Show the message, invalid username and password.
[Users module] [DONE]
Scenario 4:
1.      Login as admin
2.      Disable the access right of manager to enter his time track.
3.      Logout as admin.
4.      Login as manager.
5.      Try to enter time track
Expected result: The manager should not be able to enter his time track.
[Users module] [DONE]
Scenario 5:
1.      Login as admin
2.      Disable the access right of manager to enter others time track.
3.      Logout as admin.
4.      Login as manager.
5.      Try to enter other’s time track.
Expected result: The manager should not be able to enter other’s time track.
[Users module] [DONE]
Scenario 6:
1.      Login as admin
2.      Enable the access right of manager to enter his time track.
3.      Logout as admin.
4.      Login as manager.
5.      Try to enters his time track
Expected result: The manager should be able to enter his time track.


[Users module] [DONE]
Scenario 7:
1.      Login as admin
2.      Disable the access right of manager to enter other user’s time track.
3.      Logout as admin.
4.      Login as manager.
5.      Create the new user engineer.
6.      Logout as manager
7.      Login as engineer
8.      Assign task and enter time track.
9.      Logout as engineer.
10.  Login again as manager.
11.  Select engineer and try to modify his time track.
Expected result: Manager should be not able to modify engineer’s time track.
[Users module]   
Scenario 8:
1.      Login as admin
2.      Enable the access right of manager to enter other user’s time track.
3.      Logout as admin.
4.      Login as manager.
5.      Create the new user engineer.
6.      Logout as manager
7.      Login as engineer
8.      Assign task and enter time track.
9.      Logout as engineer.
10.  Login again as manager.
11.  Select engineer and try to modify his time track.
Expected result: Manager should be able to modify engineer’s time track.
[Users module]
Scenario 9:
1.      Login as admin
2.      Enable modify other user’s time track.
3.      Logout from admin
4.      Login as manager.
5.      Create customer and project.
6.      Assign tasks.
7.      Enter time track.
8.      Logout from manager
9.      Login as admin
10.  Try to change time track of manager
Expected result: Admin should be able to change time track of manager.
[Users module]
Scenario 10:
1.                  Login as admin
2.                  Disable the option; modify other user’s time track.
3.                  Logout from admin
4.                  Login as manager.
5.                  Create customer and project.
6.                  Assign tasks.
7.                  Enter time track.
8.                  Logout from manager
9.                  Login as admin
10.              Try to change time track of manager
Expected result: Admin should not be able to change time track of manager


[Users module]
Scenario 11:
1.      Login as admin
2.      Enable access rights to generate reports
3.      Goto reports and try to generate reports
Expected Result: Admin should be able to generate reports.
[Users module]
Scenario 12:
1.      Login as admin
2.      Disable the right to generate reports.
3.      Go to report and try to generate reports.
Expected result: admin should be able to generate reports.
[Users module]
Scenario 13:
1.      Login as admin
2.      Disable the option manage customers and projects
3.      Try to manage customers and projects
Expected result: The admin should not be able to manage customers and project.
[Users module]
Scenario 14:
1.      Login as admin
2.      Enable the option manage customers and projects
3.      Try to manage customers and projects
Expected result: The admin should be able to manage the customers and projects.




[Users module]
Scenario 15:
1.      Login as admin
2.      Disable the feature manage tasks.
3.      Go to tasks and try to manage tasks.
Expected result: The admin should not have any option to manage tasks.
[Users module]
Scenario 15:
1.      Login as admin
2.      Enable the feature manage tasks.
3.      Go to tasks and try to manage tasks.
Expected result: The admin should have options to manage tasks [Complete the tasks and delete the selected tasks]
[Users module]
Scenario 16:
1.      Login as admin
2.      Disable both the features manage customers and projects; and manage tasks.
3.      Go to tasks and try managing tasks.
Expected result: The admin should not have any option to manage tasks.
[Users module]
Scenario 17:
1.      Login as admin
2.      Enable the feature manage customers and projects.
3.      Go to tasks and try managing tasks.
Expected Result: The admin should be able to manage customers and projects; as well as he will able to manage tasks



[Users module]
Scenario 18:
1.      Login as admin
2.      Disable the feature manage work schedule
3.      Go to work schedule and try to select the working date
Expected Result: The admin should not be able to select the working date
[Users module]
Scenario 19:
1.      Login as admin
2.      Enable the feature manage work schedule
3.      Go to work schedule and try to select the working date
Expected Result: The admin should be able to select the working date
[Users module]
Scenario 20:
1.      Login as admin
2.      Disable the option Manage general Settings.
3.      Try to change the settings.
Expected Result: The manger should not be able to change the general settings
[Users module]
Scenario 21:
1.      Login as admin
2.      Enable the option Manage general Settings.
3.      Try to change the settings.
Expected Result: The manger should be able to change the general settings




[Users module]
Scenario 22:
1.      Login as admin
2.      Create the user manager1
3.      Create the user manager2
4.      Enable the  access to manager1
5.      Disable the access to manager2
6.      Go to user list
7.      Select the check box “show users with disabled access”
Expected Result: The users who are disabled must be in the user list
[Users module]
Scenario 23:
1.      Login as admin
2.      Create the user manager1
3.      Create the user manager2
4.      Enable the  access to manager1
5.      Disable the access to manager2
6.      Go to user list
7.      Select the check box “show users with disabled access”
Expected result: The users who are disabled must not be in the list
[Users module]
Scenario 24:
1.      Login as admin
2.      Create the user manager
3.      Enable the time track of manager
4.      Select manager from the list of users
5.      Try to delete the managers account
Expected Result: The manager’s account cannot be deleted and Show the message the time tracking is enabled for this user
[Users module]
Scenario 25:
1.      Login as admin
2.      Create the user manager
3.      Disable the time track of manager
4.      Select manager from the list of users
5.      Try to delete the manager’s account
Expected Result: The manager’s account can be deleted
[Login module]
Scenario 26:
1.      Login as admin
2.      Logout from admin
Expected result: The control must goes to login page
[Login module]
Scenario 27:
1.      Login as admin
2.      Logout from admin
3.      Click back button on the browser
Expected result: The control must display login page and should not go to home page of admin.
[Login module]
Scenario 28:
1.      Login as admin
2.      Close the browser without logging out.
3.      Open the browser and try to go to actitime welcome page
Expected result: The control should go to login page and not to home page of admin



[Login module]
Scenario 29:
1.      Login as admin
2.      Book mark the home page of admin.
3.      Logout from admin
4.      Open the browser and copy the bookmark and paste in address bar
Expected result: The control should not go to the home page of admin, instead it either should display error message or it should go to login page.
[Login module]
Scenario 30:
1.      Login as admin in one browser
2.      Login to the same account through another browser
3.      Logout from admin from first browser.
4.      Try to do some activities in admin account through another browser
Expected result: Whenever we try to do some activities in the 2nd browser, the browser must take the control to the login page or session expired page.
[Login module and user module]
Scenario 32:
1.      Login as admin from one browser
2.      Create the user Manager
3.      Login to the same account through another browser
4.      Disable the manager’s account through first browser
5.      Try list the disabled user
Expected result: The second browser must show the disabled users.





[Login module]
Scenario 33:
1.      Login as admin from one browser
2.      Create the user Manager
3.      Login to the same account through another browser
4.      Disable the manager’s account through second browser
5.      Try to list only enabled users in first browser
Expected result: The first browser must show only the enables users.
[Login module]
Scenario 34:
1.      Login as admin from one browser.
2.      Login  as admin to the same account through another browser
3.      Create a user in first browser
4.      Refresh the user page in second browser
Expected result: the number of users created through first browser must be listed in second browser.
[TASKSàProjects and Customers]
Scenario 36:
1.      Login as admin
2.      Go to tasks/ projects and customers
3.      Create a new customer
Expected Result: The created customer should be listed in tasks/ projects and customers page
[TASKSàProjects and Customers]
Scenario 37:
1.      Login as admin
2.      Go to tasks/ projects and customers
3.      Create a new customer
4.      Add project to the customer
Expected result: The created project should be listed in tasks/ projects and customers page along with the customer
[TASKSàProjects and Customers]
Scenario 38:
1.      Login as admin
2.      Go to tasks/ projects and customers
3.      Create a new customer
4.      Add project to the customer
5.      Add tasks to the project
Expected result: The number of added tasks should be displayed under the customer/ project name
[TASKSàProjects and Customers]
Scenario 39:
1.      Login as admin
2.      Go to tasks
3.      Click on create new tasks
4.      Select the customer and project
5.      Select the radio button show list of open tasks
Expected Result: The newly created task must be under the list of open tasks under the existing project
[TASKSàProjects and Customers]
Scenario 40:
1.      Login as admin
2.      Go to tasks
3.      Click on create new tasks
4.      Select the customer and project
5.      Select the radio button show list of active projects and customers
Expected Result: The newly created tasks must be added, before that the list of active projects should be displayed

[TASKSàProjects and Customers]
Scenario 41:
1.      Login as admin
2.      Go to tasks
3.      Click on create new tasks
4.      Select the customer and project
5.      Select the radio button show list of active projects and customers
Expected Result: If there are no active projects under the current customer, a message should be displayed “there are no tasks to create”
[TASKSàProjects and Customers]
Scenario 43:
1.      Login as admin
2.      Go to tasks
3.      Click on create new tasks
4.      Select the customer and project
5.      Enter a new task
6.      Select checkbox add to my time track
7.      Select the radio button show list of active projects and customers
Expected Result: The newly created task must be added to existing project show the task in time track
[TASKSàProjects and Customers]
Scenario 44:
1.      Login as admin
2.      Go to tasks
3.      Click on create new tasks
4.      Select the customer and project
5.      Enter a new task
6.      unselect checkbox add to my time track
7.      Select the radio button show list of active projects and customers
Expected Result: The newly created task must be under the existing project and task should not be under the time track
[TASKSàProjects and Customers]
Scenario 45:
1.      Login as admin
2.      Go to tasks
3.      Go to  down box Customers and projects, in that select “All active projects of all active customers”
Expected Result: All the customers, their projects along with the tasks should be listed
[TASKSàProjects and Customers]
Scenario 45:
1.      Login as admin
2.      Go to tasks
3.      Go to customers and projects and select the radio option in the drop down box “Select the customers and projects” under that select a customer
4.      Click apply filter
Expected Result: All the projects and tasks related to that customer must be listed
[TASKSàProjects and Customers]
Scenario 46:
1.      Login as admin
2.      Go to tasks
3.      Go to open tasks
4.      Go to customers and projects and select the radio option in the drop down box “Select the customers and projects” under that select a customer
5.      Go to filter by tasks and type the task name. click apply filter
Expected result: The only tasks typed related to selected customer should be listed




[TASKSàProjects and CustomersàCompleted task]
Scenario 47:
1.      Login as admin
2.      Go to tasks
3.      Go to open tasks
4.      Go to drop down box Customers and projects, in that select “All active projects of all active customers”
5.      Select the checkbox ahead of the tasks
6.      Click on “complete the selected tasks”
7.      Go to completed tasks
Expected result: The completed tasks must be listed
[TASKSàProjects and CustomersàCompleted TaskàOpen Task]
Scenario 48:
1.      Login as admin
2.      Go to tasks
3.      Go to open tasks
4.      Go to drop down box Customers and projects, in that select “All active projects of all active customers”
5.      Select the checkbox ahead of the tasks
6.      Click on “complete the selected tasks”
7.      Go to completed tasks
8.      Select the checkbox ahead of completed task
9.      Click on “Reopen the selected task
10.  Go to open tasks again
Expected Result: The Reopened task must be listed under the open tasks
[TASKSàOpen tasks]
Scenario 49:
1.      Login as admin
2.      Go to tasks
3.      Go to open tasks
4.      Go to drop down box Customers and projects, in that select “All active projects of all active customers”
5.      Select the checkbox ahead of the tasks
6.      Click on “Delete the selected task”
Expected Result: The selected task should not be in any list of tasks
[TASKSàOpen Tasks]
Scenario 50:
1.      Login as admin
2.      Go to tasks
3.      Go to open tasks
4.      Go to drop down box Customers and projects, in that select “All active projects of all active customers”
5.      Select the checkbox ahead of the tasks
6.      Click on “complete the selected tasks”
7.      Go to completed tasks
8.      Select the checkbox ahead of completed tasks
9.      Click on the option “Delete the selected task”

Expected Result: The deleted task should not be in any list of tasks