Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Double Click on image using Selenium

View previous topic View next topic Go down

Double Click on image using Selenium

Post by vrangaiah on Thu Sep 08, 2011 8:37 pm

I have test case where I have to double click on the image to check the test case.

Xpath from Xpath Checker :-

id('base')/x:table/x:tbody/x:tr/x:td/x:table/x:tbody/x:tr/x:td/x:table/x:tbody/x:tr[2]/x:td/x:table/x:tbody/x:tr[2]/x:td[2]/x:div/x:div/x:table/x:tbody/x:tr/x:td/x:table/x:tbody/x:tr[1]/x:td[2]/x:div/x:table/x:tbody/x:tr[1]/x:td

Xpath from Inspect Element (Copy Xpath) :-

/html/body/div[2]/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/div/div/table/tbody/tr/td/table/tbody/tr/td[2]/div/table/tbody/tr/td/img

HTML Tag :-
class="cwks-EnableHand" style="width: 48px; height:
48px;">


DoubleClick API do not work, since it works only for Button or link. In my application its image.

Please suggest if have faced same problem or if have solution

vrangaiah

Posts : 1
Join date : 2011-08-31

Back to top Go down

Re: Double Click on image using Selenium

Post by iAssets on Thu Aug 23, 2012 9:44 pm

In Selenium WebDriver (Java - 2.25.0 - 2012-07-18), the following code doesn't build:

Code:
WebDriver driver = new FirefoxDriver();
WebElement element = driver.findElement(By.xpath("yourpath"));
Actions builder = new Actions(driver);
Action doubleClick = builder.doubleClick(element).build().perform();

Eclipse says: "Type mismatch: cannot convert from void to ExecProtos.ActionList.Action".

However, the following works in Selenium WebDriver:

Code:
String baseUrl = "your url";   
String my_xpath = "yourpath";     
Selenium s = new WebDriverBackedSelenium(driver, baseUrl); 
s.doubleClick(("xpath=" + my_xpath));

Does anybody know if it (doubleclick) works in Selenium IDE? I tried in Selenium 1.9.0 (firefox), but the Command, "doubleClick" is doing NOTHING.

iAssets

Posts : 2
Join date : 2012-08-22

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