I am trying to press the find jobs button on the home page of indeed using selenium. I have used By.id, By.xpath and By.className but it is still not working. There are a lot of similar questions to the one I am asking but I already tried them and they aren't different from what I have already done. I am using the Opera browser (don't want to use others) if that matters and the version is 3.4.0.
There is no error shown after execution.
Again the question is how do I click the button using selenium and java on an opera browser?
Appreciate the help.
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.opera.OperaDriver;
import org.openqa.selenium.opera.OperaOptions;
import org.openqa.selenium.remote.DesiredCapabilities;
public class SeleniumLearning
{
WebDriver driverC;
WebDriver driverO;
public static void main(String[] args) throws InterruptedException
{
SeleniumLearning SL = new SeleniumLearning();
//SL.invokeOperaBrowser();
SL.indeedOpera();
//SL.yahooOpera();
//SL.duckduckgoOpera();
}
public void indeedOpera() throws InterruptedException
{
System.setProperty("webdriver.opera.driver", "C:\\Program Files (x86)\\Selenium Stuff\\operadriver_win64\\operadriver.exe");
driverO = new OperaDriver();
//driverO.manage().deleteAllCookies();
driverO.manage().window().maximize();
driverO.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driverO.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driverO.get("http://www.indeed.com");
driverO.findElement(By.className("input_text")).sendKeys("HR");
//Trying different methods
//These don't work individually either
Thread.sleep(3000);
driverO.findElement(By.id("fj")).click();
Thread.sleep(3000);
driverO.findElement(By.xpath("//*[@id='fj']")).click();
Thread.sleep(3000);
driverO.findElement(By.className("inwrapBorderTop")).click();
}
}