- narendercb
- Posts : 8
Join date : 2013-06-25
how to select button like filed embeded in div tag in webpage using xpath
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
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
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
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
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
selenium.click(".//*[@id=':05']/div/div");
Thanks in Advance,
Narender
- ravinderreddy
- Posts : 6
Join date : 2012-11-10
Age : 37
Location : Hyderabad/Mumbai
Re: how to select button like filed embeded in div tag in webpage using xpath
Mon Dec 30, 2013 1:20 pm
try this
//div[@class='nm']//div[2]/div[contains(text(),'doTask')]
//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
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");
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");
Re: how to select button like filed embeded in div tag in webpage using xpath
Wed Feb 19, 2014 11:54 pm
Thanks for the effort. It really helps.
- iteration with xpath to an select
- How do i find xpath for a button on web page
- Select the “back” button of the Firefox browser to right click and Select the Option from the right click Menu in Selenium Web Driver - Java
- Unable to find an element by Id, Name or Xpath using the Webdriver of IE for my webpage
- Issuing mouseDownAt(locator, "0,0") & mouseUpAt(locator, "0,0") clicks the Button twice, while issuing mouseDown(locator) and mouseUp(locator) clicks the Button once
Permissions in this forum:
You cannot reply to topics in this forum