Share
Go down
Guest
Guest

XPath idwntification probkem

on Sat Feb 09, 2013 12:05 am
Hi All,

In the below piece of HTMl , I want to write a XPATh for node

I am trying it as //input[@id='update_data']

But No luck!!! Selenium is not finding this XPath.

Can anybody help?
-SHWETA



























Re: XPath idwntification probkem

on Sat Feb 09, 2013 1:36 am
It would be better if you paste the source code as text....Also you wanted xpath for text box or button
Guest
Guest

Re: XPath idwntification probkem

on Sat Feb 09, 2013 3:42 pm
I am pasting source code as text only but somehow its converting it inHTML.
I want to click on Browse button. But somehow I am getting Xpath not identified error.
I am tring it as //input[@id='update_data']

Code:

<document>
<html>
<head>
<body>
<form id="uploaddoc" enctype="multipart/form-data" method="post" name="uploaddoc" action="fileUpload">
<div class="investment">
<div class="all-forms">
<div class="upload-content">
<div class="inside">
<div class="document-upload">
<div class="left">
<input id="update_data" class="" type="file" onchange="$(this).closest('.upload-content').find('.upload').removeClass('disabled');" name="userFile"/>
</div>
<a id="fileUploadButton" class="button small upload disabled" href="#">
</div>
<input type="hidden" name="userFileFileName"/>
<input type="hidden" name="fileIdFromServer"/>
<input id="index" type="hidden" value="1/" name="index"/>
</div>
<input class="" type="hidden" name="uploaded6"/>
</div>
</div>
</div>
</form>
</body>
</html>
</document>
rohit kumar gupta
Active particpant
Active particpant
Posts : 24
Join date : 2012-09-19
Age : 28
Location : abc

Re: XPath idwntification probkem

on Sun Feb 10, 2013 5:34 pm
xpath that you are using driver.findElement(By.xpath
("//input[@id='update_data']")); looks correct. U can be assured by placing the xpath in Selenium ide and click on find button or using the firebug. There if you are able to see the button getting highlighted then it should be correct. Else try adding other properties to xpath.
Guest
Guest

Re: XPath idwntification probkem

on Tue Feb 12, 2013 11:02 pm
I cant open this application in internet explorer. But otherwise I have checked it in IE developer bar by doing selectelementby click its showing this ID properly. This is not containing in any frame/iframe also. However still I am getting object identification problem.
rohit kumar gupta
Active particpant
Active particpant
Posts : 24
Join date : 2012-09-19
Age : 28
Location : abc

Re: XPath idwntification probkem

on Thu Feb 14, 2013 1:33 am
Hi Shweta...
What do you mean when you can not open this application..?.and for the identification i meant you have framed xpath correctly and you can validate it using the tools i mentioned
Sponsored content

Re: XPath idwntification probkem

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