Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
arifm
Active particpant
Active particpant
Posts : 12
Join date : 2012-08-08

Web driver not supporting xpath element ids Empty Web driver not supporting xpath element ids

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.
avatar
sreekumar
Active particpant
Active particpant
Posts : 16
Join date : 2011-12-27
Age : 39
Location : Hyderabad

Web driver not supporting xpath element ids Empty Re: Web driver not supporting xpath element ids

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...
avatar
arifm
Active particpant
Active particpant
Posts : 12
Join date : 2012-08-08

Web driver not supporting xpath element ids Empty Re: Web driver not supporting xpath element ids

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.
avatar
pcoulson
Posts : 2
Join date : 2012-09-12

Web driver not supporting xpath element ids Empty Re: Web driver not supporting xpath element ids

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.
avatar
arifm
Active particpant
Active particpant
Posts : 12
Join date : 2012-08-08

Web driver not supporting xpath element ids Empty Web driver

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
avatar
sreekumar
Active particpant
Active particpant
Posts : 16
Join date : 2011-12-27
Age : 39
Location : Hyderabad

Web driver not supporting xpath element ids Empty Re: Web driver not supporting xpath element ids

Wed Sep 12, 2012 2:58 pm
driver.findElement(By.xpath("//span[@id='slmTemplate']")).click();

I think so the above cmd should work
Sponsored content

Web driver not supporting xpath element ids Empty Re: Web driver not supporting xpath element ids

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