Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Query - web driver element click is not working

View previous topic View next topic Go down

Query - web driver element click is not working

Post by aks on Sun Jan 30, 2011 8:36 pm

Here is my code snnipet -

WebDriver driver = new InternetExplorerDriver();
driver.get("https://localhost:8080/fileServer/Tomcat/configuration.jsp");
...
...
...
System.out.println("Title " + driver.findElement(By.id("auto-gen15")).getAttribute("title")); // This line gives proper output

driver.findElement(By.id("auto-gen15")).click(); // This line is not working and even no error is thrown...program completes without any error.
.........
.....


When tried to record the testcase from selenium IDE and then statement comes as
selenium.click("auto-gen15");

Please help me, i m stuck here and cant find any reason for the issue. Thanks a lot in advance !!

aks

Posts : 5
Join date : 2011-01-30

Back to top Go down

Re: Query - web driver element click is not working

Post by Adviser on Mon Jan 31, 2011 7:40 pm

Hi,
may the element is not id , it may be a name. try to find out the exact id with the help of firebug.

If all is fine then try to click the element by following way:
Code:

//first declare the webelement
      WebElement oSearchButton = oWebDriver.findElement(By.name("btnG"));
     
      //then perform operation on it
      oSearchButton.click();

I think you directly used the element without defining. May be this will solve your problem.

Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

Re: Query - web driver element click is not working

Post by aks on Mon Jan 31, 2011 8:02 pm

Hi Adviser..thanks for ur reply.

I used firebug only to find the id of button and its correct.
By id i m able to get the button but still click operation is not working even by using ur way of defining element.

here is the html code of button from firebug -


?button type="button" class="btn-text coreSave" id="auto-gen15" title="Save"> ?/button

replace question mark with angular brackets


Last edited by aks on Mon Jan 31, 2011 8:08 pm; edited 1 time in total

aks

Posts : 5
Join date : 2011-01-30

Back to top Go down

Re: Query - web driver element click is not working

Post by Adviser on Mon Jan 31, 2011 9:49 pm

I think you Id is auto generated as name suggest which changes during run time. Please check whether it's changing at runtime or it's a static.

Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

Re: Query - web driver element click is not working

Post by aks on Tue Feb 01, 2011 6:00 pm

Thanks Adviser...
Didnt understand the exact issue but below statement solved my problem -

driver.findElement(By.id("auto-gen15")).sendKeys(Keys.ENTER)

Instead of click i used send "Enter" key

aks

Posts : 5
Join date : 2011-01-30

Back to top Go down

Re: Query - web driver element click is not working

Post by ChuckFirment on Wed Aug 24, 2011 4:15 am

Aks,

Did you learn any more about the cause of this? I have a test that performs a Click command. It works with the FirefoxDriver and InternetExplorerDriver, but does not work with the ChromeDriver. SendKeys works for Chrome, but I actually want to send a click, not sendkeys.

Did you ever find out more?

Chuck

ChuckFirment

Posts : 2
Join date : 2011-08-24

Back to top Go down

Re: Query - web driver element click is not working

Post by constantino.cronemberger on Thu Jun 28, 2012 8:57 pm

SendKeys is a limited workaround because it only works when the window has the focus. In my case this does not work because I want to run multiple instances in parallel so only one can have the focus...

constantino.cronemberger

Posts : 1
Join date : 2012-06-28

Back to top Go down

Re: Query - web driver element click is not working

Post by Sponsored content Today at 8:08 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum