Wednesday 17 October 2012

Project Training for BCA,MCA,BE Computer,IT,BSC IT,MSC IT,Diploma Students,IGNOU,DOEACC students

Send your email to all IT companies for enquiring about Project Training for BCA,MCA,BE Computer,IT,BSC IT,MSC IT,Diploma Students,IGNOU,DOEACC students using JustDial.com

This is automated form filling system developed using Selenium Webdriver and JAVA.

Its not a rocket science. Its simple. Just follow some instructions.

SETTING UP SELENIUM WEB DRIVER into ECLIPSE

http://selftechy.com/2011/05/31/setting-up-selenium-with-eclipse

http://www.anitpatel.net/2011/12/27/setting-up-selenium-web-driver-eclipse-testng/


Once you are ready with Eclipse and added Selenium webdriver jars in Eclipse then make one new class in eclipse and copy paste following code in that class 



public static void main(String[] args) throws InterruptedException {
              WebDriver driver = new FirefoxDriver();
              driver.manage().window().maximize();
             
              // Uncomment following command one by one and run this whole script for all this command
              // this is made for Banglore city
              // you can get more city same way by going and searching on justdialand get links
              // add that link here and run whole script again
             
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Bank");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-In-Application");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developer-ASP-Dot-Net");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Cellular-Phones");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Textile-Industry");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developer-SAP-ERP");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Education");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developer-Accounting-Management");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developer-Distributors");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developer-Real-Estate");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Call-Centre");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Colleges");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-CRM");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Departmental-Store");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Excise");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Hotels");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-HRD");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Inventory-Management");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Invoice");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Sales-TAX");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Single-Phase-Motor-Design");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Three-Phase-Motor-Design");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-For-Travel-Agents");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-In-Inventory");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Developers-In-Power-Builder");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Development-For-ERP");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Development-For-Inventory-Management");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Installation");
//            driver.navigate().to("http://www.justdial.com/Bangalore/Computer-Software-Dealers");
             
              String SearchLinkText = null;
             
             
              // Set variable j based on no of page of the search result of the Justdial.com
              // Click on Next Button 21 times
              for (int j = 1; j <= 21; j++) {
                     System.out.println("Page no" + j);
                     System.out.println("-----------------------------------");
                    
                     for(int i=1;i<=25;i++){
                          
                          
                           try {
                                  String Start = "//*[@id='mainContent']/div[3]/div[";
                                  String End = "]/div[1]/span/a";
                                 
                                  SearchLinkText = driver.findElement(By.xpath(Start+i+End)).getText() ;
                                  System.out.println(SearchLinkText + " --- is opened");
                                  driver.findElement(By.xpath(Start+i+End)).click();
                                 


                                  Thread.sleep(5000L);
                                 
                                  if (driver.findElement(By.linkText("Send Enquiry by Email")).isDisplayed()) {
                                        
                                         // Click on Send Enquiry by Email link
                                         driver.findElement(By.linkText("Send Enquiry by Email")).click();
                                        
                                  } else{
                                         System.out.println(SearchLinkText + " --- Skipping Send Enquiry by Email");
                                        
                                  }
                                 
                                 

                                  //Enter your name in "Your name" in following command
                                  driver.findElement(By.xpath("//*[@id='enqname']")).sendKeys("Your Name");
                                 
                                  //Enter your Mobile no into "Your Mobile no"  in following command
                                  driver.findElement(By.xpath("//*[@id='enqmobile']")).sendKeys("Your Mobile no");
                                 
                                  //Enter your Email ID into "Your Email ID"  in following command
                                  driver.findElement(By.xpath("//*[@id='enqemail']")).sendKeys("Your Email ID");
                                 
                                  //Enter your Email Subject into "Email Subject"  in following command
                                  driver.findElement(By.xpath("//*[@id='enqsub']")).sendKeys("Email Subject [Ex: I am looking for Project & Training in JAVA]");
                                 
                                  ////Enter your one line Email Body into "Email Subject"  in following command
                                  driver.findElement(By.xpath("//*[@id='enqbd']")).sendKeys("Enter oneline email body [Ex: I am looking for training for my 6th sem of BE CE]");
                                 
                                  driver.findElement(By.xpath("//*[@id='Enquiry']/p[9]/input")).click();
                                   
                                  Thread.sleep(10000L);
                                  driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);

                                 
                                  System.out.println("Email Sent to --- " + i);
                           } catch (Exception e) {
                           System.out.println("Unable to locate ");
                          
                           }
                           driver.navigate().back();
                          
                     }
                    
                     //Click on Next button
                     driver.findElement(By.xpath("//*[@id='srchpagination']/a[13]")).click();
                    
              }
             
             
       }