There was an error in this gadget

Technical Project Lead @ Huawei Technologies

My photo
Bangalore/Hyderabad, Karnataka/Andhra Pradesh, India
Have an overall 10 + yrs of experience Currently working as an Senior Architect.Expertise in design,implementation of Automation frameworks for Opensource automation tools like Selenium,Jmeter, Webdriver,Appium, Robotium Expertise in integrating Test & ALM Management tools like Rally,Qmetry,JIRA-Zephyr with Automation frameworks Expertise in design and developmenet Mobile Automation frameworks for tools like Appium, Robotium Remote Control,Cucumber BDD

Followers

Sunday, August 10, 2014

JIRA Zephyr Introduction

JIRA is a well known Powerful project management tool for creation and maintain project taks.
Zephyer is one of the JIRA Plugins for Test Case Management where one can create,update,execute tests manually.
ZAPI is an interface that provides RESTful services that can be called from your code to create,update and execute tests. Zephyr does not comes default with JIRA license. You need to purchase separate license to get Zephyr installed. Having this you can create your tests manually. To have your test cases get created programatically you need to purchase additional licese for ZAPI in addition to Zephyr.

In my subsequent posts I would be posting topics on

  • JIRA Rest Interface
  • ZAPI Rest Interface
  • Fetching JIRA Projects
  • Fetching JIRA test cycles
  • Creating a Test Case
  • Creating Test Steps
  • Updating Test case
  • Assigning Test Case for Execution
  • Execution of Test Cases
  • Setting Execution statuses  (PASS/FAIL,WIP)


Webdriver Jmeter Integration Approach

There are couple of ways one can Integrate Webdriver scripts with Jmeter

1. Junit Sampler
2.Web driver Sampler

More to come on the above ones

Jmeter Introdcution

I have spend some time on analyzing functional automation using open source automation tools. This time I'm looking curious to explore some open source performance tools like Jmeter.

At the time when I was a fresher , I had some learning on Jmeter on performance testing  of web application and did some analysis on measuring performance for database like Postgre and Oracle.It was just couple of months and never looked back at Jmeter

In this blog i'm putting on the analysis and outcome of my understanding on Integrating Jmeter with Selenium webdriver in the recent times.

The intention of  writing this blog is to provide some context on how the Selenium based tests can be reused to measure some performance parameters if a webpage for a single user/multiple users. It is suggested that it not a good practice to drive your Webdriver-Jmeter tests with multiple sets of Threads as Jmeter spawns multiple threads for simulating multiple user simulation. Multiple threads opens multiple browsers and that kills your system memory. How ever if you have a high end configuration machine , yes you can create multiple threads

If you want more information on Jmeter check this http://jmeter.apache.org/

In my subsequent blogs I discuss the approach

- Integrating Webdriver with Jmeter
- Distribution of Webdriver Jmeter tests
- Invoking Webdriver Jmeter tests from Apache Ant 
- Generation of HTML reports

Saturday, March 15, 2014

How to Fetch the Rally User Story List

public Map<String, Map<String, String>> getFolderList() throws IOException {
if (folderReferenceMap.isEmpty()) {
QueryRequest folderRequest = new QueryRequest("TestFolder");
// spaces
folderRequest.setFetch(new Fetch("FormattedID", "Name"));
LOGGER.info("Feting the folder list from Rally for project ["
+ ReadProperties.getInstance().getProperty("rallyProject")
+ "]");
folderRequest.setQueryFilter(new QueryFilter("Project.Name", "=",
ReadProperties.getInstance().getProperty("rallyProject")));
QueryResponse folderQueryResponse = restApi.query(folderRequest);
// JsonObject testSetJsonObject =
// testSetQueryResponse.getResults().get(0).getAsJsonObject();
JsonArray resultArray = folderQueryResponse.getResults();
for (JsonElement result : resultArray) {
String rallyFolderObjId = result.getAsJsonObject().get("_ref")
.getAsString();
LOGGER.debug(rallyFolderObjId);
String rallyFolderName = result.getAsJsonObject()
.get("_refObjectName").getAsString();
// System.out.println(rallyFolderName);

String formattedId = result.getAsJsonObject()
.get("FormattedID").getAsString();
// System.out.println(formattedId);

String testFolder = "testfolder";
int stringPosition = rallyFolderObjId.indexOf(testFolder)
+ testFolder.length() + 1;
rallyFolderObjId = rallyFolderObjId.substring(stringPosition,
rallyFolderObjId.length());
// System.out.println(rallyFolderObjId);
Map<String, String> folderMap = new HashMap<String, String>();
folderMap.put(rallyFolderObjId, rallyFolderName);
folderReferenceMap.put(formattedId, folderMap);

}
LOGGER.debug("Folder list loading  from Rally is complete");
}

return folderReferenceMap;

}

How to fetch the Rally Folder List

public Map<String, Map<String, String>> getFolderList() throws IOException {
if (folderReferenceMap.isEmpty()) {
QueryRequest folderRequest = new QueryRequest("TestFolder");
// spaces
folderRequest.setFetch(new Fetch("FormattedID", "Name"));
LOGGER.info("Feting the folder list from Rally for project ["
+ ReadProperties.getInstance().getProperty("rallyProject")
+ "]");
folderRequest.setQueryFilter(new QueryFilter("Project.Name", "=",
ReadProperties.getInstance().getProperty("rallyProject")));
QueryResponse folderQueryResponse = restApi.query(folderRequest);
// JsonObject testSetJsonObject =
// testSetQueryResponse.getResults().get(0).getAsJsonObject();
JsonArray resultArray = folderQueryResponse.getResults();
for (JsonElement result : resultArray) {
String rallyFolderObjId = result.getAsJsonObject().get("_ref")
.getAsString();
LOGGER.debug(rallyFolderObjId);
String rallyFolderName = result.getAsJsonObject()
.get("_refObjectName").getAsString();
// System.out.println(rallyFolderName);

String formattedId = result.getAsJsonObject()
.get("FormattedID").getAsString();
// System.out.println(formattedId);

String testFolder = "testfolder";
int stringPosition = rallyFolderObjId.indexOf(testFolder)
+ testFolder.length() + 1;
rallyFolderObjId = rallyFolderObjId.substring(stringPosition,
rallyFolderObjId.length());
// System.out.println(rallyFolderObjId);
Map<String, String> folderMap = new HashMap<String, String>();
folderMap.put(rallyFolderObjId, rallyFolderName);
folderReferenceMap.put(formattedId, folderMap);
xAFTRallyScenarioDataMap.getInstance().setFolderReferenceMap(
folderReferenceMap);
}
LOGGER.debug("Folder list loading  from Rally is complete");
}

return folderReferenceMap;

}

How to get the List of all Test Cases

//Below Code fetches the list of TestCases based on Filter (Project,Folder,Owner..)

public List<String> getTestCaseDetails(RallyRestApi restApi,
String methodName, String folder, String projectName)
throws IOException {
// All Test cases
QueryRequest testcases = new QueryRequest("Test Case");
testcases.setFetch(new Fetch("FormattedID", "Name", "Owner",
"Test Folder"));
testcases.setQueryFilter(new QueryFilter("Project.Name", "=",
projectName).and(
new QueryFilter("TestFolder.Name", "=", folder)).and(
new QueryFilter("Method", "=", methodName)));
testcases.setOrder("FormattedID ASC");
QueryResponse queryResponse = restApi.query(testcases);
JsonArray testCaseList = new JsonArray();
if (queryResponse.wasSuccessful()) {
System.out.println(String.format("\nTotal results: %d",
queryResponse.getTotalResultCount()));

testCaseList = queryResponse.getResults().getAsJsonArray();
for (JsonElement testCase : testCaseList) {
JsonObject json = new JsonObject();
json = testCase.getAsJsonObject();
System.out.println(json.get("FormattedID"));
System.out.println(json.get("LastVerdict"));
System.out.println(testCase);
testCaseInfoList.add(testCase.toString());
}
} else {
for (String err : queryResponse.getErrors()) {
System.err.println("\t" + err);
}
}
return testCaseInfoList;
}

How to get list of Rally Projects

public Map<String, List<String>> getProjectReferenceMap()
throws IOException {
// Get the workspace references
List<String> workspaceReferenceList = getWorkSpaceReferences();
String workSpaceName = "";
String projectRef = "";
GetRequest workspaceRequest;
GetResponse workspaceResponse;
Map<String, List<String>> projectWorkSpaceMap = new HashMap<String, List<String>>();
List<String> projectList = new ArrayList<String>();
// Iterate through each workspace and get all the project associated
// with each workspace
for (String workspaceRef : workspaceReferenceList) {
// Get the workspaces
if (workspaceRef.equalsIgnoreCase("workSpace")) {
workspaceRequest = new GetRequest(workspaceRef);
workspaceRequest.setFetch(new Fetch("Name", "Projects"));
workspaceResponse = restApi.get(workspaceRequest);
JsonObject workspaceObj = workspaceResponse.getObject();
JsonArray workspaceArray = workspaceObj.get("Results")
.getAsJsonArray();
JsonObject jo;
JsonElement projRef;
// For each workspace get the list of projects
for (int i = 0; i < workspaceArray.size(); i++) {
jo = workspaceArray.get(i).getAsJsonObject();
workSpaceName = jo.get("Name").getAsString();
projRef = jo.get("Projects");
JsonObject jobject = projRef.getAsJsonObject();
JsonElement je = jobject.get("_ref");
projectRef = je.toString();
projectList.add(projectRef);
}
projectWorkSpaceMap.put(workSpaceName, projectList);
}

}

return projectWorkSpaceMap;
}

How to fetch the Rally WorkSpace Reference


//Below code would return the list of Workspaces
private List<String> getWorkSpaceReferences() throws IOException {
List<String> workSpaceRefArray = new ArrayList<String>();
// Get Subscription Response
JsonObject subscriptionObject = getSubScriptionResponse();
// From the workspaces get all workspaces
JsonElement workSpaces = subscriptionObject.get("Workspaces");

// Check if the subscription contains multiple projects which are
// returned as an array
if (workSpaces.isJsonArray()) {
// TODO
} else {
// Get the single workspace
JsonObject myWorkspaceObject = workSpaces.getAsJsonObject();
JsonObject workspaceObject = myWorkspaceObject.getAsJsonObject();
// Get the workspace reference
String workspaceRef = workspaceObject.get("_ref").getAsString();
workSpaceRefArray.add(workspaceRef);
}
return workSpaceRefArray;
}

How to get User Subscription details from Rally




//Below code gives the User Details Subscriptions
private JsonObject getSubScriptionResponse() {

                RallyRestApi restApi = new RallyRestApi(new URI(rallyURL),
"user@yourcomapany.com", "password");
QueryRequest subscriptionRequest = new QueryRequest("Subscriptions");
subscriptionRequest.setFetch(new Fetch("Name", "SubscriptionID",
"Workspaces", "Name"));

QueryResponse subscriptionQueryResponse = null;
JsonObject subscriptionQueryObject = null;
try {
subscriptionQueryResponse = restApi.query(subscriptionRequest);
JsonArray subscriptionQueryResults = subscriptionQueryResponse
.getResults();
JsonElement subscriptionQueryElement = subscriptionQueryResults
.get(0);
subscriptionQueryObject = subscriptionQueryElement
.getAsJsonObject();
this.subscriptionId = subscriptionQueryObject.get("SubscriptionID")
.toString();
System.out.println("Read Subscription: " + subscriptionId);
} catch (IOException e) {
e.printStackTrace();
}
return subscriptionQueryObject;

}

How to Delete Rally Test Cases


How to Update Rally Test Cases and TestCase Steps

//Below code allows you to update TestCase name as well as the Test Steps associated with the Test Case

public static void getTestSteps() throws IOException, URISyntaxException,
JSONException {
String rallyURL = "https://us1.rallydev.com";
RallyRestApi restApi = new RallyRestApi(new URI(rallyURL),
"xxxx@yourcompany.com", "password");

                //Query the Test Case that you want to update
QueryRequest testCaseRequest = new QueryRequest("TestCase");
testCaseRequest.setFetch(new Fetch("TC2033", "Name", "Steps")); //
testCaseRequest.setQueryFilter(new QueryFilter("FormattedID", "=",
"TC2033"));
QueryResponse testCaseResponse = restApi.query(testCaseRequest);
String testCaseName = "";
JsonArray jArray = testCaseResponse.getResults();
JsonObject testCase = jArray.get(0).getAsJsonObject();
testCaseName = jArray.get(0).getAsJsonObject().get("_refObjectName")
.getAsString();
System.out.println("Updating the test case with new Description ");
                      //Get the Test Case Object Refernce
String testCaseObjReference = jArray.get(0).getAsJsonObject()
.get("_ref").getAsString();
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("Name", "Final test New Test Case Name");
                         //Update the test case
UpdateRequest tcUpdateRequest = new UpdateRequest(
testCaseObjReference, jsonObject);
UpdateResponse updateResponse = restApi.update(tcUpdateRequest);
if (updateResponse.wasSuccessful()) {
System.out.println("Test case Name updated successfully");
System.out.println("Now updating the test steps");
} else {
System.out.println("Failed to update Test Case Name");
}

    QueryRequest testStepRequest = new QueryRequest(
testCase.getAsJsonObject("Steps"));
testStepRequest.setFetch(new Fetch("StepIndex", "Input",
"ExpectedResult"));
JsonArray testCaseSteps = restApi.query(testStepRequest)
.getResults();
for (int j = 0; j < testCaseSteps.size(); j++) {
System.out.println(testCaseSteps.get(j).getAsJsonObject()
.get("StepIndex").getAsString()
+ ": "
+ testCaseSteps.get(j).getAsJsonObject().get("Input")
.getAsString()
+ ":"
+ testCaseSteps.get(j).getAsJsonObject()
.get("ExpectedResult").getAsString());
System.out.println(testCaseSteps.get(j).getAsJsonObject()
.get("_ref").getAsString());
String testStepRefObject = testCaseSteps.get(j)
.getAsJsonObject().get("_ref").getAsString();
JsonObject testCaseStepObject = new JsonObject();
testCaseStepObject.addProperty("Input", "NewStepThree");
UpdateRequest updateRequest = new UpdateRequest(
testStepRefObject, testCaseStepObject);
UpdateResponse upResponse = restApi.update(updateRequest);
if (upResponse.wasSuccessful()) {
System.out.println("Successfuly Updated");
} else {
System.out.println("Failed to update");
}

}
}

How to add attachements to Rally test cases

//This Snippet will Update Test Case Result and add Attachment to a Test Case


// Create and configure a new instance of RallyRestApi
// Connection parameters
String rallyURL = "https://rally1.rallydev.com";
String wsapiVersion = "v2.0";
String applicationName = "RestExample_CreateTestCaseResultAddAttachment";

// Credentials
String userName = "user@company.com";
String userPassword = "topsecret";

RallyRestApi restApi = new RallyRestApi(new URI(rallyURL), userName,
userPassword);
restApi.setWsapiVersion(wsapiVersion);
restApi.setApplicationName(applicationName);

// Workspace and Project Settings
String myWorkspace = "/workspace/12345678910";
String myProject = "/project/12345678911";

// Test Case to which we want to add a result
String testCaseFormattedID = "TC40";

// User name of tester
String testerRallyID = "tester@testit.com";

// Reference to created TestCaseResult
String testCaseResultRef = "";

// File handle for image to attach
RandomAccessFile myImageFileHandle;
String imageFilePath = "/home/username/Pictures/";
String imageFileName = "image1.txt";
String fullImageFile = imageFilePath + imageFileName;
String imageBase64String;
long attachmentSize;

// Open file
myImageFileHandle = new RandomAccessFile(fullImageFile, "r");

// Read User
QueryRequest userRequest = new QueryRequest("User");
userRequest.setFetch(new Fetch("UserName", "Subscription",
"DisplayName"));
userRequest.setQueryFilter(new QueryFilter("UserName", "=",
testerRallyID));
QueryResponse userQueryResponse = restApi.query(userRequest);
JsonArray userQueryResults = userQueryResponse.getResults();
JsonObject userQueryObject = userQueryResults.get(0).getAsJsonObject();
String userRef = userQueryObject.get("_ref").getAsString();

// Query for Test Case to which we want to add results
QueryRequest testCaseRequest = new QueryRequest("TestCase");
testCaseRequest.setFetch(new Fetch("FormattedID", "Name"));
testCaseRequest.setQueryFilter(new QueryFilter("FormattedID", "=",
testCaseFormattedID));
QueryResponse testCaseQueryResponse = restApi.query(testCaseRequest);
JsonObject testCaseJsonObject = testCaseQueryResponse.getResults()
.get(0).getAsJsonObject();
String testCaseRef = testCaseQueryResponse.getResults().get(0)
.getAsJsonObject().get("_ref").getAsString();

// Query for Test Set to which we want to add Test Case
QueryRequest testSetQuery = new QueryRequest("TestSet");
testSetQuery.setFetch(new Fetch("FormattedID", "Name", "TestCases"));
testSetQuery.setWorkspace(myWorkspace);
testSetQuery.setProject(myProject);
testSetQuery.setQueryFilter(new QueryFilter("FormattedID", "=", "TS5"));
QueryResponse testSetQueryResponse = restApi.query(testSetQuery);
JsonObject testSetJsonObject = testSetQueryResponse.getResults().get(0)
.getAsJsonObject();
String testSetRef = testSetJsonObject.get("_ref").getAsString();
System.out.println("Test Set Ref: " + testSetRef);

try {

// Add a Test Case Result
System.out.println("Creating Test Case Result...");
JsonObject newTestCaseResult = new JsonObject();
newTestCaseResult.addProperty("Verdict", "Inconclusive");
newTestCaseResult.addProperty("Date", "2013-09-04T18:00:00.000Z");
newTestCaseResult.addProperty("Notes",
"Automated Selenium Test Runs");
newTestCaseResult.addProperty("Build", "2013.09.04.0020101");
newTestCaseResult.addProperty("Tester", userRef);
newTestCaseResult.addProperty("TestCase", testCaseRef);
newTestCaseResult.addProperty("TestSet", testSetRef);

CreateRequest createRequest = new CreateRequest("testcaseresult",
newTestCaseResult);
CreateResponse createResponse = restApi.create(createRequest);

if (createResponse.wasSuccessful()) {

System.out.println(String.format("Created %s", createResponse
.getObject().get("_ref").getAsString()));

// Read Test Case Result
testCaseResultRef = Ref.getRelativeRef(createResponse
.getObject().get("_ref").getAsString());
System.out.println(String.format(
"\nReading Test Case Result %s...", testCaseResultRef));
GetRequest getRequest = new GetRequest(testCaseResultRef);
getRequest.setFetch(new Fetch("Date", "Verdict"));
GetResponse getResponse = restApi.get(getRequest);
JsonObject obj = getResponse.getObject();
System.out.println(String.format(
"Read Test Case Result. Date = %s, Verdict = %s", obj
.get("Date").getAsString(), obj.get("Verdict")
.getAsString()));

try {
// Get and check length
long longLength = myImageFileHandle.length();
long maxLength = 5000000;
if (longLength >= maxLength)
throw new IOException(
"File size >= 5 MB Upper limit for Rally.");
int fileLength = (int) longLength;

// Read file and return data
byte[] fileBytes = new byte[fileLength];
myImageFileHandle.readFully(fileBytes);
imageBase64String = Base64.encodeBase64String(fileBytes);
attachmentSize = fileLength;

// First create AttachmentContent from image string
JsonObject myAttachmentContent = new JsonObject();
myAttachmentContent.addProperty("Content",
imageBase64String);
CreateRequest attachmentContentCreateRequest = new CreateRequest(
"AttachmentContent", myAttachmentContent);
CreateResponse attachmentContentResponse = restApi
.create(attachmentContentCreateRequest);
String myAttachmentContentRef = attachmentContentResponse
.getObject().get("_ref").getAsString();
System.out.println("Attachment Content created: "
+ myAttachmentContentRef);

// Now create the Attachment itself
JsonObject myAttachment = new JsonObject();
myAttachment.addProperty("TestCaseResult",
testCaseResultRef);
myAttachment.addProperty("Content", myAttachmentContentRef);
myAttachment.addProperty("Name", "AttachmentFromREST.jpg");
myAttachment.addProperty("Description",
"Attachment From REST");
myAttachment.addProperty("ContentType", "image/jpg");
myAttachment.addProperty("Size", attachmentSize);
myAttachment.addProperty("User", userRef);

CreateRequest attachmentCreateRequest = new CreateRequest(
"Attachment", myAttachment);
CreateResponse attachmentResponse = restApi
.create(attachmentCreateRequest);
String myAttachmentRef = attachmentResponse.getObject()
.get("_ref").getAsString();
System.out.println("Attachment  created: "
+ myAttachmentRef);

if (attachmentResponse.wasSuccessful()) {
System.out.println("Successfully created Attachment");
} else {
String[] attachmentContentErrors;
attachmentContentErrors = attachmentResponse
.getErrors();
System.out
.println("Error occurred creating Attachment: ");
for (int i = 0; i < attachmentContentErrors.length; i++) {
System.out.println(attachmentContentErrors[i]);
}
}
} catch (Exception e) {
System.out
.println("Exception occurred while attempting to create Content and/or Attachment: ");
e.printStackTrace();
}

} else {
String[] createErrors;
createErrors = createResponse.getErrors();
System.out
.println("Error occurred creating Test Case Result: ");
for (int j = 0; j < createErrors.length; j++) {
System.out.println(createErrors[j]);
}
}

} finally {
// Release all resources
restApi.close();
myImageFileHandle.close();
}
}

How to add test steps to an Exiting test cases in Rally


Friday, January 31, 2014

Inspecting IOS elements and recording tests using Appium on Simulator

1.Download & Install the GUI version of Appium server(check appium.io)
2.Open the Appium server. You should see some thing like below




















3. We would be inspecting the IOS element using this GUI version of appium
4. Check the flag AppPath an provide the path to your .app(you can find the path from Xcode)
Ex: The path I provided here is '/Users/kiran/Library/Developer/Xcode/DerivedData/UICatalog-fqsvdhmisheuvqbsuomezsujnqgi/Build/Products/Debug-iphonesimulator/UICatalog.app'
5.Ensure you pick the .app path which is in 'Debug-iphonesimulator' folder and not 'Debug-iphoneos folder (when you run the UICatalog code on a real device from Xcode, the .app will be created in 'Debug-iphoneos).
6.Now click on 'Launch' button to start the appium server.
7.Click on 'i' button to launch the IOS inspector
8.Check the below video to see how to inspect elements on IOS simulator and record the tests

You can even play back  the tests with in the appium recorder
Check the following video link to have a glance on how to inspect and record
https://www.youtube.com/watch?v=BNgFixhS_AM&feature=youtu.be

You can run your tests either starting the appium from GUI mode or from terminal mode.
Now lets c how to run the tests when appium is launched from terminal
Stop the GUI mode appium server
open the terminal and type the command appium &. This will launch the appium server on default port 4723


Tuesday, January 28, 2014

Rally API integration with Java

Recently I worked on Rally API integration with our Java Automation framework .Rally is the ALM (Application Life Management tool) . In this blog I would be posting my experiences in Integrating Rally API and the context would be more on Test Management

Rally exposes some webservices typically REST services that allows user to Manage the Test Management. To access the webservices Rally does not provide any API. How ever there are many open source Rest Clients for Java,C#,python.....

I used Java Rest Client to access the Rally REST services you can download the libraries from the link
https://github.com/RallyTools/RallyRestToolkitForJava

How to update the test cases in rally with our Automation Test case results

Will soon post the BLOG...

How to create a Test Case using Rally Rest API

Will soon post the BLOG

How to Query for list of Test Cases using Query Filter

Will soon post the BLOG

How to Login in to Rally using Java Rest API client

To access to Rally you need to login authentication
public RallyRestApi authenticate() throws URISyntaxException, Exception {

            //Provide Rally url,username and password
            RallyRestApi restApi = new RallyRestApi(new URI(https://us1.rallydev.com),
"username, "password");

          //If you are behind a proxy server provide the following
            restApi.setProxy("proxyserver", "userName", "password");
try {
if (restApi == null) {
LOGGER.debug("Authenticating Rally with provided credentials");
System.out.println("Initializing Rally Connector with user : "
+ userName);
LOGGER.debug("Trying to connect and login to rally : ");
restApi = new RallyRestApi(new URI(rallyUrl), userName,
password);
QueryRequest userRequest = new QueryRequest("User");
// userRequest.setFetch(new Fetch("UserName", "Subscription",
// "DisplayName"));
userRequest.setQueryFilter(new QueryFilter("UserName", "=",
ReadProperties.getInstance().getProperty("username")));
QueryResponse userQueryResponse;

userQueryResponse = restApi.query(userRequest);
JsonArray userQueryResults = userQueryResponse.getResults();
JsonElement userQueryElement = userQueryResults.get(0);
JsonObject userQueryObject = userQueryElement.getAsJsonObject();
String userRef = userQueryObject.get("_ref").toString();
LOGGER.info("Rally Authentication Successful!");
}
} catch (Exception e) {
LOGGER.error("Failed to Authenticate User [" + userName + "]"
+ e.getMessage());
e.printStackTrace();
}
return restApi;
}

Thursday, January 9, 2014

Inspecting IOS elements using Appium Inspector for .app file

  1. Launch the appium Server (GUI version)
  2. You need to setup additional Parameters using to run the tests on Real Devices
  3. Choose the app path. Here you need to choose from Xcode iphoneos folder as mentioned in one of my previous blog ex: /Users/kiran/Library/Developer/Xcode/DerivedData/UICatalog-fqsvdhmisheuvqbsuomezsujnqgi/Build/Products/Debug-iphoneos/UICatalog.app
  4. Check the option UDID. UDID is the device ID. You can find it from Xcode Organiser.
  5. Open xcode. Open organiser which is on top right of your Xcode
  6. Select you device in the left list of the organiser
  7. You should be able to see the device information
  8. Here Identifier is the UDID.
  9. provide this is identifier in the appium server option UDID
  10. Select option Force Device with selected option as iPhone
  11. Select option BundleID. This is the application bundle id. To find this Id follow the below screenshot
  1. I used Iphone configuration utility(freeware) to find the app bundle path. Google it and your should be able to find the download references
  2. Open the Iphone config utility, Under Application you should be able to see the app bundle id. In this case, 'com.yourcompany.UICatalog'. Set this to the appium server option 'BundleID'
  1. Start the appium server
  2. Click on Inspector Icon
  3. You should see your Iphone Screen in the Inspector