Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

View previous topic View next topic Go down

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

Post by narendercb 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

Back to top Go down

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

Post by narendercb 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

Back to top Go down

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

Post by narendercb on Wed Oct 02, 2013 11:06 am

Gentle reminder

narendercb

Posts : 8
Join date : 2013-06-25

Back to top Go down

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

Post by narendercb 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

narendercb

Posts : 8
Join date : 2013-06-25

Back to top Go down

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

Post by ravinderreddy on Mon Dec 30, 2013 1:20 pm

try this

//div[@class='nm']//div[2]/div[contains(text(),'doTask')]

ravinderreddy

Posts : 6
Join date : 2012-11-10
Age : 29
Location : Hyderabad/Mumbai

Back to top Go down

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

Post by narendercb 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");

narendercb

Posts : 8
Join date : 2013-06-25

Back to top Go down

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

Post by acts79 on Wed Feb 19, 2014 11:54 pm

Thanks for the effort. It really helps.

acts79

Posts : 3
Join date : 2014-02-18

http://ny.pe

Back to top Go down

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

Post by Sponsored content Today at 5:13 pm


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