Clicking on an element in robot framework is not working in IE but its working fine in Chrome Firefox

0 votes

Clicking on the Element is not working in Robot Framework. In the log.html, it shows that it clicked on the element, but it does not actually happen in the browser.

The element which I want to click is:

<a href="http://www.twitter.com/intent/tweet?text=Orange%20named%20a%20Top%20Employer%20Global%202018%20for%203rd%20consecutive%20year&amp;url=http%3A%2F%2Fintegration-ruby.proj.620nm.com%2Fen%2Fblogs%2Forange-named-top-employer-global-2018-3rd-consecutive-year&amp;via=orangebusiness" class="share-button-twitter" target="_blank" title="Share on twitter">
        <span class="fa-lg fa-stack text_black"> <i class="fa fa-circle-thin fa-stack-2x"></i> <i class="fa fa-twitter fa-stack-1x"></i> </span>
    </a>

I run my test using:

Execute JavaScript    document.querySelector(".share-button-twitter").click()
Execute JavaScript    document.querySelector('a[title="Share on twitter"]').click()
Execute JavaScript    document.querySelector(".fa-lg fa-stack text_black").click()
Click Link  //a[@title="Share on twitter"]
Click Element    //i[@class="fa fa-twitter fa-stack-1x"]
Click Element    //span[@class="fa-lg fa-stack text_black"]

The element is visible in the page, and the script works fine in Chrome and Firefox I find this essue with the browser IE.

What can be the reason for this? Any idea to solve the problem?

Mar 30, 2018 in Selenium by Shubham
• 13,490 points
12,252 views

You can try below code for Robot

Press Key    //i[@class="fa fa-twitter fa-stack-1x"]    \\13
Make sure you've 4 spaces after "Press Key" and 4 after the locator
It worked for me in IE

3 answers to this question.

0 votes
The only solution to this problem is: Update your Internet Explorer to the latest version. Also download the appropriate supported version of IEDriver for that version of IE. The problem is only here, and no where else. Nothing is wrong with the code and that is evident from the execution on Chrome & Firefox.
answered Mar 30, 2018 by nsv999
• 5,500 points
0 votes
Hello,

i have the same problem , did u find the solution ?

thanks.
answered Jun 14, 2019 by Miya

Hi Miya, I got a workaround for this kind of problems, as suggested by @nsv999 I updated my IE browser to the latest version. Also I used thread.sleep() and webdriver.wait() methods to let the elements load properly before performing actions on them like click element.

0 votes
public class SiblingAndParentInXpath {

    @Test

    public void testSiblingAndParentInXpath(){

    	WebDriver driver;
    	String driverPath = "C:\\geckodriver.exe";
    	System.setProperty("webdriver.gecko.driver", driverPath);
        driver = new FirefoxDriver();        
        
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        driver.get("https://www.acerdentalct.com/");
answered Apr 24, 2020 by Blazzzinglight
public class SiblingAndParentInXpath {

    @Test

    public void testSiblingAndParentInXpath(){

    	WebDriver driver;
    	String driverPath = "C:\\geckodriver.exe";
    	System.setProperty("webdriver.gecko.driver", driverPath);
        driver = new FirefoxDriver();        
        
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        driver.get("facebook.com");

Related Questions In Selenium

0 votes
1 answer

Xpath not working in firefox but working fine in chrome

Try to search above xpath in chrome ...READ MORE

answered Jul 17, 2018 in Selenium by Samarpit
• 5,910 points
3,516 views
0 votes
0 answers

How to hover element when action class is not working in my Selenium framework ?

When i am writing the code to ...READ MORE

Feb 16, 2019 in Selenium by Raishul
3,954 views
0 votes
0 answers

xpath search working on browser[firefox/Chrome] but not on Selenium python script.

Hi Team, I am getting below expception while ...READ MORE

Nov 14, 2019 in Selenium by ashutosh
• 120 points
2,352 views
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8, 2019 in Selenium by Anvi
• 14,150 points
15,887 views
0 votes
1 answer

Confused betwen Java AWT Robot & Selenium Actions

There are plenty of differences between the ...READ MORE

answered Apr 6, 2018 in Selenium by nsv999
• 5,500 points
5,950 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,776 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,190 views
0 votes
1 answer
0 votes
2 answers

Unable to Click on an Element in Selenium (Python) even after finding it.

Here, I give you working script which ...READ MORE

answered Sep 19, 2018 in Selenium by Priyaj
• 58,020 points
24,206 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP