Spread the love

Issues with Sendkeys Not Working With Different Browser

Spread the love


Issue Details:With the latest IEDriver, It is seen sendKeys method is not able to push data into testarea. The same method works great with Firefox and Chrome.

There is one more issue upon clicking on save button, the text entered, gets disappear.

What to check:

The check points are:
Check the version of Selenium,IEDriverServer.exe, Internet Explorer [For IE11, we need selenium 2.44 or above.]
Resolution:
There might be a workaround-Just press a Tab using Sendkeys(“TAB”). It might trigger the underlaying javascript
The main issue is problem related to nativeEvents in IE.
Issue Details:
Sendkeys may send data one character by one character. As a result execution becomes very slow.

What to check:
The driver version. In 64 bit of drivers , It may so happen. Downgrade the driver to 32 bit.Also you need to check the same version of IEDriverServer.exe. So basically if you are using 32 bit of browser, the driver has to be 32 bit.

Issue Details:
Sendkeys may send data partially in parallel mode of execution but sends full string while running in one thread.

What to check:
Check the application type.It is very common in Angular JS applications.Always upgrade the library to the latest Angular JS.
if you can not upgrade the Angular JS,use the following code:


var i;
for(i = 0; i < toxtToSend.length; i++){
EditBox.sendKeys(toxtToSend.charAt(i));
}

or we can try with java script executor class:


WebDriver driver = new FirefoxDriver();
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("document.getElementById('gbqfq').value = 'Test';");

one more solution could be to use java.awt package:
Initial phase set the focus to the element and write the below code:


driver.findElemnt(by.xpath("abc")).setfocus();
paste();

public static void paste() throws AWTException
{
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyRelease(KeyEvent.VK_V);
}

Issue Details:
Sendkeys does not work properly when using gecodriver.

READ  How to Resolve NoSuchSessionException in selenium free?
READ  What Is Desired Capabilities in Selenium?

What to check:
Either use

System.setProperty(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE,"false");

 or using Firefox options setting up the capabilities




Spread the love
Animesh Chatterjeehttps://techtravelhub.com/
I am the founder and owner of the blog - TechTravelHub.com, always love to share knowledge on test automation,tools,techniques and tips.I am a passionate coder of Java and VBScript.I also publish articles on Travel ideas and great honeymoon destinations.Apart from these, I am a gear-head,love to drive across India. I have shared lots of articles here on How to travel several parts of India.Customization of cars aka car modification is my another hobby.Get in touch with me on ani01104@gamil.com

Related Articles

How to Resolve NoSuchSessionException in selenium free?

How to Resolve NoSuchSessionException in selenium? NoSuchSessionException in Selenium is a tricky...

Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Recent Posts

Super Keyword in Java Simplified

Super Keyword Super Keyword in Java Simplified: Java defines a special...

Learn Object Repository in UFT in An Efficient and Fast Manner

Object Repository in UFT The post will cover the following...

Learn What Primary Tools For Test Automation

Primary Tools For Test Automation According to the Gartner report...

EDITOR PICKS


Spread the love