Archive

Archive for July, 2013

Adding and deleting a cookie with Selenium

It’s simple ūüôā

// Now set the cookie. This one’s valid for the entire domain
Cookie cookie = new Cookie(“key”, “value”);
driver.manage().addCookie(cookie);

// And now output all the available cookies for the current URL
Set<Cookie> allCookies = driver.manage().getCookies();
for (Cookie loadedCookie : allCookies) {
System.out.println(String.format(“%s -> %s”, loadedCookie.getName(), loadedCookie.getValue()));
}

// You can delete cookies in 3 ways
// By name
driver.manage().deleteCookieNamed(“CookieName”);
// By Cookie
driver.manage().deleteCookie(loadedCookie);
// Or all of them
driver.manage().deleteAllCookies();

I’ve found this in the selenium site

Font: http://docs.seleniumhq.org/docs/03_webdriver.jsp

Advertisements

Free site for yours project organization (Kanban, Scrum)

Open saved profiles in Firefox – Selenium (WebDriver)

Hello, I will put the code that you need for open some saved profile in Firefox with Selenium.

ProfilesIni profilesIni = new ProfilesIni();
FirefoxProfile profile = profilesIni.getProfile(“default“); //This is the name of profile, you can find this in the folder of firefox profiles.
WebDriver driver = new FirefoxDriver(profile);
 
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); // Only necessary if you have invalid certificates in the page
                
profile.setPreference(“network.proxy.type”, 0); // open without proxy
profile.setAcceptUntrustedCertificates(true); // Only necessary if you have invalid certificates in the page
profile.setAssumeUntrustedCertificateIssuer(false); // Only necessary if you have invalid certificates in the page
 
I use this way for open a saved profile that contains a personal certificate. I needed open 
a page with this certificate installed.
 
Bye bye ūüôā

Investing in federal securities, the basic

Hello guys, today I will talk about federal securities, just the basic for you begin invest.

Here in Brazil we have federal securities pos-fixed and pre-fixed, this means that some federal securities, have the % of¬†profitability already fixed and you knows how much you will gain in the final of maturity. The pos-fixed federal security don’t have the % of profitability and you will gain according some index in the month.

The federal securities in Brazil are:

  • LTN: This federal securities is pre-fixed and you know how much is the profitability in the buy moment. It is very simple, you will gain the value of the face (money invested + profitability money) in the maturity date.
  • NTN-F: This federal securities is pre-fixed, with profitability in the buy moment. The profitability is received every half year (profitability money) and in the maturity date (money invested + profitability money in the month).¬†
  • NTN-B main: This federal securities is pre-fixed and¬†depends of the variation of IPCA (Index of consumer prices) with profitability in he buy moment. Keeps the value of the buy and protect him of fluctuations of the prices. You will gain the value of the face (money invested + profitability money) in the maturity date.
  • NTN-B:¬†This federal securities is pre-fixed and¬†depends of the variation of IPCA (Index of consumer prices) with profitability in he buy moment.¬†Keeps the value of the buy and protect him of fluctuations of the prices.The profitability is received every half year (profitability money) and in the maturity date (money invested + profitability money in the month).¬†
  • LFT:¬†This federal securities is pos-fixed and depends Selic index (interest rate). Your profitability usually is less than others federal securities, because has low volatility, avoiding loss in the case of early sales.¬†You will gain the value of the face (money invested + profitability money) in the maturity date.
  • NTN-C:¬†This federal securities is pos-fixed and depends IGP-M index (general market prices).¬†The profitability is received every half year (profitability money) and in the maturity date (money invested + profitability money in the month). Nowadays, this federal securities are sold only in the¬†Wednesday.

This is the basic for you about how invest in federal securities of Brazil.

Bye ūüôā

Font: https://www.tesouro.fazenda.gov.br/pt/caracteristicas-dos-titulos-publicos

%d bloggers like this: