Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Help Please!(Eclipse Luna)
Help Please! [message #1705880] Wed, 19 August 2015 18:48
Singh King is currently offline Singh KingFriend
Messages: 1
Registered: August 2015
Junior Member
Hi All,
I am new to the forum and I really need your help. I was trying to use Selenium Webdriver, I installed Eclipse Luna on windows and I am trying to enter Java code to automate a process from a webpage. So, that being said, I want to give example of what I am trying to do, please see below:

I am trying to automate -- like the browser opens up, I sign in, I see the main webpage and I click on a link. What code would go in Eclipse to make it automatically click on a link and a new page opens up? Please give a example from a webpage. Below is what I have for code so far:

package com.indeed.tests;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class IndeedJobSearch {

public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub

//Create firefox driver to drive the browser
//WebDriver driver = new ChromeDriver();
//System.setProperty("webdriver.chrome.driver",
//"C:\\Users\\drandhawa\\Desktop\\chromedriver_win32\\chromedriver.exe");
//driver.get("http://www.indeed.co.uk");

System.setProperty("webdriver.ie.driver",
"C:\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver();

//
driver.get("http://www.indeed.co.uk");

//Find what field and enter Selenium
Thread.sleep(2000);
driver.findElement(By.id("what")).sendKeys("Selenium");
//Find location field and enter London
driver.findElement(By.id("where")).clear();
Thread.sleep(2000);
driver.findElement(By.id("where")).sendKeys("London");
//Find FindJobs button and click on it
Thread.sleep(2000);
driver.findElement(By.id("fj")).click();
//From job search results page, get page title and jobs count message

System.out.println(driver.getTitle());
System.out.println(driver.findElement(By.id("searchCount")).getText());

driver.close();


}

}
Previous Topic:getting eclipse php programs to run in Apache server
Next Topic:reports fetching using birt and mysql db
Goto Forum:
  


Current Time: Sun Nov 29 00:09:06 GMT 2020

Powered by FUDForum. Page generated in 0.03236 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top