Wednesday, November 28, 2012

Networking Definition

  1. SMTP: SMTP (Simple Mail Transfer Protocol) is a set of standard Internet procedures by which two email providers (ex. Gmail, Yahoo Mail), transfer email messages to one another’s mail servers.
  2. domain: A domain is a name for an IP address and is more commonly recognized as a website or web address. For example, Google.com is a domain.
  3. SSL: SSL (secure socket layer) is a way of changing data such as your username and password into code as it travels across the Internet, so that the data will be secure and private.
  4. ISP: An ISP (Internet Service Provider) is a company (ex. AOL, AT&T, and Comcast) that gives your computer Internet access. ISPs are usually the companies that come to your house and set up all the wires.
  5. TLS: TLS (Transport Layer Security) is a way of changing data such as your username and password into code as it travels across the Internet, so that the data will be secure and private. With mail delivery, TLS begins with an unsecured connection to the mail servers, and then upgrades to a secure connection once information is sent.
  6. POP: POP (Post office protocol) is a one-way download of your messages that allows you to access your mail with a mail program like Outlook Express or Apple Mail. POP only offers one-way communication, which means that actions you take in the mail program (like marking a message as read) won’t be synced to Gmail.
  7. IMAP: IMAP (Internet message access protocol) lets you download messages from Gmail so you can access your mail with a program like Outlook Express or Apple Mail. IMAP syncs the actions you take in Outlook Express or Apple Mail with Gmail so if you read a message in your mail client, it'll be marked as read in Gmail.

Friday, November 2, 2012

Switching Frame and Windows in WebDriver sample code


1> Switch to different Frames:
 List<WebElement> frameset = driver.findElements(By.tagName("frame"));  
 if(frameset.size()>0) {  
 for (WebElement framename : frameset){  
 System.out.println("frameid: " + framename.getAttribute("name"));  
 }  
 }  
 else System.out.println("can not find any frame in HTML");  

Notice when you set the frame index, it starts with 0 for the first frame:
 driver.switchTo().frame(0);  


2> Switch to different Windows:
 Set<string> handlers = driver.getWindowHandles();  
 if (driver.getWindowHandles().size()>= 1){  
 for(String handler : handlers){  
 driver.switchTo().window(handler);  
 if (driver.getCurrentUrl().contains("Popup")){  
 System.out.println("Get focus on Popup window");  
 break;  
 }  
 }  
 }  
 else System.out.println("No windows founded!");  


Writing a common function based you own app for switching will be more helpful for your Code Clean!