Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Selenium WebDriver Integration
Yesterday at 1:06 pm by azharuddin

» 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

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Web driver not supporting xpath element ids

View previous topic View next topic Go down

Web driver not supporting xpath element ids

Post by arifm on Mon Sep 10, 2012 10:55 pm

I converted an ide script to java/web driver. But in web driver code get element by x path not supported. Please reply asap.

arifm
Active particpant
Active particpant

Posts : 12
Join date : 2012-08-08

Back to top Go down

Re: Web driver not supporting xpath element ids

Post by sreekumar on Tue Sep 11, 2012 2:22 pm

Hi arifm

Could you write the script that you did in selenium IDE. I will change the code to that support to Web driver and Xpath...

sreekumar
Active particpant
Active particpant

Posts : 16
Join date : 2011-12-27
Age : 32
Location : Hyderabad

Back to top Go down

Re: Web driver not supporting xpath element ids

Post by arifm on Tue Sep 11, 2012 3:44 pm

Sreekumar,

these are commands I used in IDE and Web driver.
In IDE it is working , but in web driver it is not working.

click //span[@id='slmTemplate']/div/div/table/tbody/tr/td- Command in IDE (x path- ID Relative)

driver.findElement(By.xpath("//span[@id='slmTemplate']/div/div/table/tbody/tr/td")).click(); Command in webdriver.

arifm
Active particpant
Active particpant

Posts : 12
Join date : 2012-08-08

Back to top Go down

Re: Web driver not supporting xpath element ids

Post by pcoulson on Wed Sep 12, 2012 12:27 am

try this:
driver.findElement(By.id("//*[@id='slmTemplate']").click();

As the span has id, it is the best to use id instead of xpath.

pcoulson

Posts : 2
Join date : 2012-09-12

Back to top Go down

Web driver

Post by arifm on Wed Sep 12, 2012 1:41 pm

pcoulson wrote:try this:
driver.findElement(By.id("//*[@id='slmTemplate']").click();

As the span has id, it is the best to use id instead of xpath.

I used this,It is not working. It is a javascript Application menu.Please suggest any other method

arifm
Active particpant
Active particpant

Posts : 12
Join date : 2012-08-08

Back to top Go down

Re: Web driver not supporting xpath element ids

Post by sreekumar on Wed Sep 12, 2012 2:58 pm

driver.findElement(By.xpath("//span[@id='slmTemplate']")).click();

I think so the above cmd should work

sreekumar
Active particpant
Active particpant

Posts : 16
Join date : 2011-12-27
Age : 32
Location : Hyderabad

Back to top Go down

Re: Web driver not supporting xpath element ids

Post by Sponsored content


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