Dependency:
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
Code:
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
OR
WebDriverManager.firefoxdriver().setup();
driver = new FirefoxDriver();
OR
WebDriverManager.iedriver().version("3.0.0").setup();
driver = new InternetExplorerDriver();
Showing posts with label setup. Show all posts
Showing posts with label setup. Show all posts
Saturday, 1 December 2018
Tuesday, 31 May 2016
setting up protractor
Download and install NodeJS. http://nodejs.org/download/.
To verify your installation, please type in the command
npm –version
Install Protractor
Globally:
Open the command prompt and type in the following command to
install protractor globally. (Using npm)
This will install two command line tools, protractor and
webdriver-manager.
npm install -g
protractor
To verify your installation, please type in the command
Protractor --version
If Protractor is installed successfully then the system will
display the installed version. Otherwise you will have to recheck the
installation.
Grid Setup:
The webdriver-manager is a helper tool to easily get an
instance of a Selenium Server running. Use it to download the necessary
binaries with:
webdriver-manager
update
Now start up a server with:
webdriver-manager
start
This will start up a Selenium Server and will output a bunch
of info logs. Your Protractor test will send requests to this server to control
a local browser. You can see information about the status of the server at http://localhost:4444/wd/hub.
Write a Simple Test:
( save as FirstSpec.js)
describe('angularjs
homepage todo list', function() {
it('should add a todo', function() {
browser.get('https://angularjs.org');
element(by.model('todoList.todoText')).sendKeys('write first protractor
test');
element(by.css('[value="add"]')).click();
var todoList =
element.all(by.repeater('todo in todoList.todos'));
expect(todoList.count()).toEqual(3);
expect(todoList.get(2).getText()).toEqual('write
first protractor test');
// You wrote your first test, cross it off
the list
todoList.get(2).element(by.css('input')).click();
var completedAmount =
element.all(by.css('.done-true'));
expect(completedAmount.count()).toEqual(2);
});
});
Configuration ( save
as conf.js)
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['FirstSpec.js']
};
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['FirstSpec.js']
};
To Run The Test:
Run>protractor conf.js
Run>protractor conf.js
That’s all.
Tuesday, 19 April 2016
Version controller : GIT Setup.
Installing and
configuring GIT
Download Git
software:
Select the suitable binary file and install it. (Installation
is pretty straight forward, by clicking Next Next )
You can see these three tools installed. Git Bash, Git CMD, Git GUI.
These three software
are meant for same goal.
Create a Git Account:
Browse https://github.com/
Signup an account.
Now, We need to say Git hub that my laptop is valid to make
a connection.
For this, we need to generate a SSH key in local and add the
same in GitHub.
Generate ssh Key:
Open Git Bash.
Paste the text below,
substituting in your GitHub email address.
ssh-keygen -t rsa -b 4096 -C
"your_email@example.com"
# Creates a new ssh key, using the provided email as a label
Generating public/private rsa key pair.
When you're prompted to "Enter a file in which to save
the key," press Enter. This accepts the default file location.
Enter a file in which to save the key
(/Users/you/.ssh/id_rsa): [Press enter]
At the prompt, type a secure passphrase. For more
information, see "Working with SSH key passphrases".
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
Here is the ssh key generates: C:\Users\User_Account\.ssh ( Replace User_Account with system login
id)
File Name : id_rsa.pub
Now, Browse https://github.com/settings/profile
Click on SSH and GPG keys link on the left hand side
Click on ‘new SSH key’ button and then copy FULL content of id_rsa.pub file and paste in the ‘key’
text and click on ‘Ass ssh key’ button.
With this, our laoptop is validated to perform pull, push
operations from our github account.
Subscribe to:
Posts (Atom)