Share
View previous topicGo downView next topic
narendercb
Posts : 8
Join date : 2013-06-25

how to select button like filed embeded in div tag in webpage using xpath

on Sat Sep 28, 2013 10:54 pm
Hi,
i have following html source taken from firebug

<div class="parent">
.
.
.
 <div class="nm" role="navigation">
  <div id=":05" class="ac">
   <div class="z0">
    <div class="abc uvw xyz" ……>doTask</div>

there is button like field in my webpage with the labeled with doTask ,i need to Click on this button

->i have tried following but didn't worked, can you please help in solving this

1.selenium.click("//div[contains(text(), 'doTask')]");
2.selenium.click("//div:contains(.,'doTask')");
3.selenium.click("//div[starts-with(@class, 'abc')]");

4.selenium.click("//div[starts-with(@class, 'abc.uvw.xyz')]");


Thanks,
Narender
narendercb
Posts : 8
Join date : 2013-06-25

Re: how to select button like filed embeded in div tag in webpage using xpath

on Sat Sep 28, 2013 10:55 pm
This is i want to do in Selenium RC
narendercb
Posts : 8
Join date : 2013-06-25

Re: how to select button like filed embeded in div tag in webpage using xpath

on Wed Oct 02, 2013 11:06 am
Gentle reminder
narendercb
Posts : 8
Join date : 2013-06-25

Re: how to select button like filed embeded in div tag in webpage using xpath

on Wed Oct 02, 2013 11:40 am
i have tried getting this id from Selenium ide,but that also still not working

selenium.click(".//*[@id=':05']/div/div");

Thanks in Advance,
Narender
ravinderreddy
Posts : 6
Join date : 2012-11-10
Age : 31
Location : Hyderabad/Mumbai

Re: how to select button like filed embeded in div tag in webpage using xpath

on Mon Dec 30, 2013 1:20 pm
try this

//div[@class='nm']//div[2]/div[contains(text(),'doTask')]
narendercb
Posts : 8
Join date : 2013-06-25

Re: how to select button like filed embeded in div tag in webpage using xpath

on Tue Dec 31, 2013 3:15 pm
Thanks for the reply,i have able to do that using below

firebug html source small change in source from earlier i have posted

<div class="nm" role="navigation">
  <div id=":05" class="ac">
   <div class="z0">
     <strong>doTask</strong>

i have used
selenium.click("css=#:05 > div.z0 > strong");
acts79
Posts : 3
Join date : 2014-02-18
http://ny.pe

Re: how to select button like filed embeded in div tag in webpage using xpath

on Wed Feb 19, 2014 11:54 pm
Thanks for the effort. It really helps.
Sponsored content

Re: how to select button like filed embeded in div tag in webpage using xpath

View previous topicBack to topView next topic
Permissions in this forum:
You cannot reply to topics in this forum