Thursday, December 31, 2015
Wednesday, December 30, 2015
Git-Gerrit Made Easy - Part 2
First Procedure:
1. At First, commit your change to local
branch.
2. ($ git log --oneline --decorate --graph). Then grab
the commit id.
3.
fetch my origin ($
git fetch origin)
4.
and then rebase master. ($ git rebase origin/master)
5.
Then I have to give the push command.( $ git push origin HEAD:refs/for/develop).
6.
Finished. Now need new code for further
development:
7.
$ git fetch origin
8.
$ git checkout -b task#2021 origin/develop
Second Procedure:
l At First, commit your change to local
branch.
l ($ git log --oneline --decorate --graph). Then grab
the commit id.
l fetch my origin ($ git fetch origin)
l and then rebase
master. ($ git rebase origin/master)
l If any kind of problem occurs in
rebasing position. I have to create a new branch from origin/master. Then
cherry-pick the previous commit id. Then push it.
l Create a new branch (git checkout -b bug#75#L origin/master)
l Then cherry-pick the commit id(git cherry-pick b6e82b5)
l Then I have to give
the push command.( $ git push origin
HEAD:refs/for/develop).
l After pushing, we
need to create a new branch for further coding. For this reason we need to
fetch the origin. Then I have to create a branch.
l $ git fetch origin
l $ git checkout -b
task#2021 origin/develop
REVIEW, FEEDBACK AND PATCH SET:
I
have pushed all fixes. My TL reviews the code and want some comments. So he
gives some feedback. I have added all comments and make a patch set using the
previous commit ID 26889. All step are given below step by step:
USER@zakir-rizvi MINGW64 /c/bapf/eBuilder722/eclipse/workspace/bookstore_project
(bug#75#1)
$ git push origin HEAD:refs/for/develop
Counting
objects: 17, done.
Delta
compression using up to 4 threads.
Compressing
objects: 100% (13/13), done.
Writing
objects: 100% (17/17), 2.56 KiB | 0 bytes/s, done.
Total
17 (delta 10), reused 0 (delta 0)
remote:
remote:
New Changes:
remote: https://review.g2it.com:8443/26889
remote:
To
ssh://abu.rizvi@review.g2it.com:29418/bookstore_project
* [new branch] HEAD -> refs/for/develop
USER@zakir-rizvi MINGW64 /c/bapf/eBuilder722/eclipse/workspace/bookstore_project
(bug#75#1)
$ git branch
* bug#75#1
master
USER@zakir-rizvi MINGW64 /c/bapf/eBuilder722/eclipse/workspace/bookstore_project
(bug#75#1)
$ git push origin HEAD:refs/changes/26889
Counting
objects: 17, done.
Delta
compression using up to 4 threads.
Compressing
objects: 100% (13/13), done.
Writing
objects: 100% (17/17), 2.54 KiB | 0 bytes/s, done.
Total
17 (delta 10), reused 0 (delta 0)
To
ssh://abu.rizvi@review.g2it.com:29418/bookstore_project
* [new branch] HEAD -> refs/changes/26889
USER@zakir-rizvi MINGW64 /c/bapf/eBuilder722/eclipse/workspace/bookstore_project
(bug#75#1)
$ git push origin HEAD:refs/changes/26889
Counting
objects: 17, done.
Delta
compression using up to 4 threads.
Compressing
objects: 100% (13/13), done.
Writing
objects: 100% (17/17), 2.54 KiB | 0 bytes/s, done.
Total
17 (delta 10), reused 0 (delta 0)
To
ssh://abu.rizvi@review.g2it.com:29418/bookstore_project
* [new branch] HEAD -> refs/changes/26889
Wednesday, December 23, 2015
Git-Gerrit Made Easy - Part 1
First Procedure:
1. At First, commit your change to local
branch.
2. ($ git log
--oneline --decorate --graph). Then grab the commit id.
3.
fetch my origin ($ git fetch origin)
4.
and then rebase master. ($ git rebase
origin/master)
5.
Then I have to give the push command.( $ git
push origin HEAD:refs/for/develop).
Second Procedure:
l At First, commit your change to local
branch.
l ($ git log
--oneline --decorate --graph). Then grab the commit id.
l fetch my origin ($
git fetch origin)
l and then rebase
master. ($ git rebase origin/master)
l If any kind of problem occurs in
rebasing position. I have to create a new branch from origin/master. Then
cherry-pick the previous commit id. Then push it.
l Create a new branch (git checkout -b
bug#75#L origin/master)
l Then cherry-pick the commit id(git
cherry-pick b6e82b5)
l Then I have to give
the push command.( $ git push origin HEAD:refs/for/develop).
Thursday, November 19, 2015
Git Made Easy - Part 4
Once I got a problem. I have tried to checkout my master branch dev. But got an irrelevant message. thats given below.
$ git checkout dev
Switched to branch 'dev'
Your branch is ahead of 'origin/dev' by 1 commit.
(use "git push" to publish your local commits)
My manager give me a quick solution thats given below:
$ git reset --hard HEAD~1
$ git checkout dev
Switched to branch 'dev'
Your branch is ahead of 'origin/dev' by 1 commit.
(use "git push" to publish your local commits)
My manager give me a quick solution thats given below:
$ git reset --hard HEAD~1
Tuesday, November 3, 2015
Git Made Easy - Part 3
When we want to push any branch, we need to get log files. There are 3 ways to get log files. They are --
1. git
log
2. git
log –stat
3. git
log –oneline
$ git
log
commit 2297ac77d75a57aa1760e2e7560fe331e832a644
Author:
Rizvi <abu.rizvi@rgroup.com>
Date: Tue Nov 3 14:37:24 2015 +0600
Some changes#1
commit 78d5c1ba8efef0ee6c715ab957a1a7a2ae65b3ef
Author:
Rizvi <abu.rizvi@rgroup.com>
Date: Tue Nov 3 13:39:46 2015 +0600
.gitignore added
Description:
“git log” gives commit number, author name, commit date and commit message.
$ git
log --stat
commit 2297ac77d75a57aa1760e2e7560fe331e832a644
Author:
Rizvi <abu.rizvi@rgroup.com>
Date: Tue Nov 3 14:37:24 2015 +0600
Some changes#1
src/org/generics/MaximumTest.java | 57 +++++++++++++++++++--------------------
src/org/generics/Test.java |
9 +++++++
2 files changed, 36 insertions(+), 30
deletions(-)
Description:
“git log --stat” gives commit number, author name, commit date, commit message,
name of classes which are changed and number of files.
$ git
log --oneline
2297ac7 Some changes#1
78d5c1b .gitignore added
1987f90 Generics features added
b3e47f6 Thread Class newly added
63b4126 Merge pull request #3 from
rizvi/br1005#ext
Description:
“git log --stat” gives commit numbers and commit messages.
N.B.: If
you amend, then git force push.
Scenerio:
First br2009 is pushed to master
$ git push origin br2009:master
Then I
have not created any branch and worked on same branch br2009. I amend the new
code and then push forcibly makes success.
$ git push origin br2009:master -f
Generics Made Easy - Part 2
Double.compare(d1,d2)
·
d1 --
first double to compare
·
d2 --
second double to compare.
0, if d1
is numerically equal to d2;
<0, if
d1 is numerically less than d2;
>0, if
d1 is numerically greater than d2.
General
Format:
package org.generics;
public class MaximumTestFirst {
public static void main(String[] args) {
System.out.println(maximum(7.5, 6.5));
}
private static double maximum(double d1, double d2) {
double max = d1;
if (Double.compare(max, d2) <
0) {
max = d2; //
d2 is the largest so far
}
return max;
}
}
Generics
Standard Format:
package org.generics;
public class MaximumTestFirst {
public static void main(String[] args) {
System.out.println(maximum(7.5, 6.5));
}
private static <T extends Comparable<T>>
T maximum(T d1, T d2) {
T max = d1;
if (d2.compareTo(max) > 0) {
max = d2; //
d2 is the largest so far
}
return max;
}
}
Converting area:
Method type
|
double
|
<T extends
Comparable<T>> T
|
Parameter type
|
(double d1,
double d2)
|
(T d1, T d2)
|
Differences
|
Double.compare(max,
d2)
|
d2.compareTo(max)
|
Generics Made Easy - Part 1
- http://stackoverflow.com/questions/420223/what-is-the-difference-between-compare-and-compareto
- http://stackoverflow.com/questions/864773/resource-for-learning-java-generics
- http://www.javaspecialists.eu/archive/Issue140.html
- http://docs.oracle.com/javase/tutorial/extra/generics/index.html
- http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html
- http://codesod.com/2013/04/14/an-introduction-to-generics-in-java-part-1/
Monday, October 5, 2015
Multiple Browser Parallel Execution for Test Automation
Multiple Browser Parallel Execution:
SuitePortalMultipleBrowser.xml
<?xml version="1.0"
encoding="UTF-8"?>
<suite name="Parallel_Execution"
parallel="tests" thread-count="2"
verbose="10">
<listeners>
<listener
class-name="org.imaginea.jenkins.plugins.testinprogress.testng.TestNGProgressRunListener" />
</listeners>
<test name='Test1'>
<classes>
<class name='com.net.OfficersPortalTest'
/>
</classes>
</test>
<test name='Test2'>
<classes>
<class name='com.net.DisplaySettingsPortalTest'
/>
</classes>
</test>
<test name='Test3'>
<classes>
<class name='com.net.MessagePortalTest'
/>
</classes>
</test>
<test name='Test4'>
<classes>
<class name='com.net.FamilynFriendsPortalTest'
/>
</classes>
</test>
</suite>
Here,
·
parallel = “tests” Ã It helps to parallel run of
test classes.
·
thread-count = “2” Ã 2 is number of browser
which are executed parallelly. Here we can use 3, 4 or so on.
·
Verbose =”10” Ã Verbose Attribute lets you obtain clear
reports through IDE console. This attribute will be placed inside the
<Suite> tag of testng.xml as shown below:
<suite name="Parallel_Execution"
parallel="tests" thread-count="2"
verbose="10">
Some
conditions also needed to perform parallel browser execution for elementary
level.
Condition
- 1: RemoteWebDriver will not be static.
/**
* driver for the browser
*/
public
RemoteWebDriver driverBrowser;
Condition
- 2: If we want to quit the browser after processing every test class, we need
to add the method in every test class.
/**
* Called by TestNG after each Test is called.
*
* @throws Exception
*/
@AfterTest(alwaysRun = true)
public void testCleanUp() throws Exception {
if (driverBrowser != null) {
driverBrowser.quit();
}
}
Monday, September 21, 2015
Thursday, September 17, 2015
Wednesday, September 16, 2015
Thursday, September 10, 2015
Jenkins Master Slave
- http://stackoverflow.com/questions/12822723/distribute-test-script-to-slaves-with-same-build
- http://www.donaldsimpson.co.uk/2011/10/06/jenkins-slave-nodes/
- https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds
- http://stackoverflow.com/questions/30039685/how-to-run-selenium-test-suite-on-jenkins-simultaneously
- http://stackoverflow.com/questions/11252827/how-to-start-the-test-in-parallel-with-selenium-grid-2
- http://stackoverflow.com/questions/14785516/selenium-grid-2-parallel-test-case-execution?rq=1
- http://stackoverflow.com/questions/24755904/selenium-tests-not-running-in-parallel-in-grid-using-testng?rq=1
- http://blog.wedoqa.com/2013/07/how-to-run-parallel-tests-with-selenium-webdriver-and-testng-2/
- https://www.packtpub.com/sites/default/files/downloads/Distributed_Testing_with_Selenium_Grid.pdf
- http://santoshsarmajv.blogspot.in/2013/02/passing-parameters-to-testcase-using.html
Tuesday, September 1, 2015
Monday, August 31, 2015
Grouping in Selenium
<?xml
version="1.0" encoding="UTF-8"?>
<!DOCTYPE
suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite
name="Suite1">
<test name="test1">
<groups>
<define name="all">
<exclude
name="functest"/>
<include
name="checkintest"/>
</define>
<run>
<include
name="all"/>
</run>
</groups>
<classes>
<class
name="GroupTestExample" />
</classes>
</test>
Monday, August 24, 2015
Friday, August 14, 2015
Important Links
- https://quizlet.com/64482214/gre-princetonreview-2015-set-3-flash-cards/
- http://www.majortests.com/gre/wordlist_01
- http://nextopusa.com/important_books_for_GRE/
- http://dxschool.org/gre/
- http://www.princetonreview.com/grad/gre-test-prep
- http://greprepclub.com/forum/free-gre-practice-tests-506.html
- https://plus.google.com/+TheGREonline/posts/iMmiCqadhDZ
- http://www.thegreonline.com/2015/04/download-cracking-gre-premium-2015-with.html
Thursday, August 13, 2015
Git Made Easy - Part 1
$ git checkout main_dev
$ git pull
When first pull gives "Already up-to-date.". Then I can proceed in this way.
$ git checkout task#r1005
$ git push origin task#r1005:main_dev
$ git checkout main_dev
$ git pull
$ git checkout -b task#r1006
$ git pull
When first pull gives "Already up-to-date.". Then I can proceed in this way.
$ git checkout task#r1005
$ git push origin task#r1005:main_dev
$ git checkout main_dev
$ git pull
$ git checkout -b task#r1006
Git Made Easy - Part 2
Approach #2
$ git checkout main_dev$ git pull
src/test/resources/testdata.json | 9 ++
18 files changed, 454 insertions(+), 338 deletions(-)
$ git checkout -b task#r1001#ext
$ git checkout task#r1001
$ git log
commit 6e86b7b50d10623eec33f49917a7c3c50a4cff2a
Author: Rizvi <abu.rizvi@gmail.com>
Date: Wed Aug 5 14:49:04 2015 +0600
RZ# Facility Portal fix and new Test Cases.
$ git checkout task#r1001#ext
$ git cherry-pick 6e86b7b50d10623eec33f49917a7c3c50a4cff2a
$ git push origin task#r1001#ext:main_dev
$ git checkout main_dev
$ git pull
src/test/resources/testdata.json | 10 +-
3 files changed, 528 insertions(+), 10 deletions(-)
$ git checkout -b task#r1002
From first pull, if we get any kind of changes, insertions or deletions, we have to follow above rule.
we have to make another branch named by task#r1001#ext which containing everyone's updated code.
Here task#r1001 is containing only my updates. So I need to take the log file to get my commit number. Then I go to branch task#r1001#ext which is updated except my new commit code. So, I want to cherry-pick from this branch giving my commit number.
Then I will push the updated to main_dev. Then I will pull so that I can get my all changes here. Here after I will make new branch to work further.
Tuesday, May 19, 2015
Wait and Thread.sleep(value) Links
Selenium Special Links for Wait and Thread.sleep(value):
- http://chon.techliminal.com/ajax_wait/#/intro
- http://sqa.stackexchange.com/questions/5022/webdriverwait-or-implicitlywait-or-explictlywait-nothing-works
- http://stackoverflow.com/questions/15122864/selenium-wait-until-document-is-ready
- http://www.bizalgo.com/2012/01/14/timing-races-selenium-2-implicit-waits-explicit-waits/
- http://stackoverflow.com/questions/5868439/wait-for-page-load-in-selenium
Subscribe to:
Posts (Atom)