How can I send data in text field using Selenium? - java

I'm having an issue when I'm going to send data in text field. I got an exception.
I'm using Firefox version 54.0b1 (32-bit) and Selenium 3.3.1.
driver.findElement(By.xpath(".//*[#id='email']")).sendKeys("Test");
The exception:
Exception in thread "main" org.openqa.selenium.InvalidArgumentException: Expected [object Undefined] undefined to be a string

you need to download the latest gecko driver for Mozilla Firefox 54.x and Selenium 3.x.
Also provide accurate path as follows:
System.setProperty("webdriver.gecko.driver", "C:\\directory\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("http:\\yoururl.com");
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement(By.xpath(".//*[#id='email']")).sendKeys("Test");
Hope it will work for you.

This is actually a Firefox issue and issue have been recorded. Go through the below link for more info
https://bugzilla.mozilla.org/show_bug.cgi?id=1357661

Related

Chrome Browser not opening in Selenium Webdriver

My chrome browser not opening in Selenium Webdriver .I have downloaded all things like chrome driver , selenium jars and chrome according to compatibility. I am using Intellij IDEA IDE.The code and version details are given below -
System.setProperty("webdriver.chrome.driver","C:\driver\chromedriver_win32.exe");
WebDriver driver = new ChromeDriver();
Versions:
Chrome:89.0.4389.90
IDE:IntelliJ IDEA : 203.7148.57
Chrome driver: https://chromedriver.storage.googleapis.com/index.html?path=89.0.4389.23/
Selenium Webdriver: selenium-java-4.0.0-beta-2
(I have tried with selenium old version as well)
Please give some suggestions .
Thanks .
Remove _win32 and than try
System.setProperty("webdriver.chrome.driver","C:\driver\chromedriver.exe");
WebDriver driver = new ChromeDriver();

Load unpacked extension is disabled in developer

I am trying to Invoke Chrome through Selenium Webdriver. It was initially working well. For the past 2 days i am getting an error message
I also noticed that the Load Unpacked Extensions is disabled in my browser.
And here is the Java Program I use
System.setProperty("webdriver.chrome.driver","C:\Users\C59122\Desktop\SELENIUM\chromedriver_win32\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
String regur = "https://google.com";
driver.get(regur);
Can someone please help me fix the problem?

When the below code is executed, firefox is showing error. I am using the latest version of java, eclipse, firefox, and WebDrive jar file

System.setProperty("webdriver.gecko.driver", "C:\\Users\\vinil\\Downloads\\geckodriver-v0.11.1-win64\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.jobserve.com/in/en/Job-Search/");
driver.findElement(By.xpath("//*[#id='ddcl-selInd']/span/span")).click();
Thread.sleep(5000);
driver.quit();
[]
This happens on driver.quit() when you are closing the browser.
It is unfortunately known issue when quitting geckodriver firefox instance, see this links for details.
https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/7506 https://bugzilla.mozilla.org/show_bug.cgi?id=1027222

Selenium not able to identify the newly opened window in the IE browser

I am not able to identify a newly opened window in my application.
After using driver.get("my app url") when I try to click on any object, I am getting org.openqa.selenium.NoSuchWindowException: Unable to find element on closed window.
I replicated the same issue on flipkart website using the below code :
System.setProperty("webdriver.ie.driver","path to IEDriverServer.exe);
WebDriver driver = new InternetExplorerDriver();
driver.get("https://www.flipkart.com");
Thread.sleep(10000); // just for sample
driver.findElement(By.linkText("24x7 Customer Care")).click();
But when I run it I am getting NoSuchWindowException.
It is working fine in chrome and Firefox browser.
Selenium Version =2.53.0 ,
OS= Windows7
I tried by adding ignoreProtectedMode and IntroduceFlakinessByIgnoringSecurityDomains capabilities as well but even that is working.
Kindly assist.
Use this it works for you
System.setProperty("webdriver.ie.driver", "path to IEdriverServer.exe" );
WebDriver driver =new InternetExplorerDriver();
driver.manage().window().maximize();
driver.get("https://www.flipkart.com");

Selenium compatability with Firefox and Chrome

I am able to run the script successfully on Firefox and i am not able to run the same script on Chrome. Please help me in finding these issue.
Thanks
Hi to run test in chrome please call chrome driver like below
// call the Chrome driver as below first
System.setProperty("webdriver.chrome.driver", "D:\\eclipseProject\\##\\src\\com\\##\\chromedriver_win32\\chromedriver.exe");
// path to chrome exe that you have downloaded form given url (below)
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://www.seleniumhq.com"); // link to your web-table web page
now your script as same on firfox
// download chrome exe form this link http://docs.seleniumhq.org/download/

Categories