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
Guest
Guest

XPath idwntification probkem Empty XPath idwntification probkem

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



























XPath idwntification probkem Empty Re: XPath idwntification probkem

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
avatar
Guest
Guest

XPath idwntification probkem Empty Re: XPath idwntification probkem

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>
avatar
rohit kumar gupta
Active particpant
Active particpant
Posts : 24
Join date : 2012-09-19
Age : 34
Location : abc

XPath idwntification probkem Empty Re: XPath idwntification probkem

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.
avatar
Guest
Guest

XPath idwntification probkem Empty Re: XPath idwntification probkem

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.
avatar
rohit kumar gupta
Active particpant
Active particpant
Posts : 24
Join date : 2012-09-19
Age : 34
Location : abc

XPath idwntification probkem Empty Re: XPath idwntification probkem

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

XPath idwntification probkem Empty Re: XPath idwntification probkem

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