Error while entering data into payment section flipkart pom | Selenium Forum
M
Posted on 04/06/2016
hi ,

facing an error unable to enter data using pom framework

please find attachment and provide solution


org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"//*[contains(@placeholder,'Card Number')]"}
Command duration or timeout: 30.28 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:55:52'

M
Replied on 05/06/2016

before watching the frameworks please watch how create a custom xpath(module 12).


M
Replied on 06/06/2016

hi ,

Please tell me what is the wrong with this Xpath for validate it after making any custom xpath I also check whether any node is identified with this xpath or not any it is which node.

I am requesting please reply with solution where I did mistake.


M
Replied on 06/06/2016

this xpath is all wrong

[code:1po6lmgz]//*[contains(@placeholder,'Card Number')][/code:1po6lmgz]

the above xpath will not work in java selenium.


the java selenium xpath looks more like

[code:1po6lmgz]//*[@id="wrapcentre"]/form/div[/code:1po6lmgz]


the the difference between the 2.


M
Replied on 06/06/2016

Hi,

I did not understand what you want to say please explain .....
and please also tell me what should be Correct Xpath for this screen I am not able to view your xpath in the Attached screen

Plz explain and tell me the correct xpath

Responsive image

M
Replied on 06/06/2016

the xpath in your screen shot should work fine use that.


M
Replied on 07/06/2016

Not Working Please can you wrote down here the appropriate Xpath after checking form your end.


M
Replied on 07/06/2016

send me the link.


M
Replied on 08/06/2016

Project is attached with my Query Plz execute it.


M
Replied on 11/06/2016

plz reply


M
Replied on 11/06/2016

I tried this too, But strangely its not able to locate component with explicit wait too.
Though Card Number has inner input field too :
<div class="frm-el-wr card-no-wr txt-el-wr">
<label class="frm-el-lbl" for="card-no">CARD NUMBER</label>
<input id="card-no" class="frm-el frm-el-tx card-no-el auto-for only-number plc-hd" placeholder="Card Number" maxlength="19" autocomplete="off" name="pan"/>
</div

@Ashish : Could you please try it once and tell ?


M
Replied on 12/06/2016

hi deepak i'll reply in 24 hours.


M
Replied on 12/06/2016

okay

thanks
deepak


M
Replied on 15/06/2016

xpath for card number
[color=#FF0000:189fi1h2]//*[@id="card-no"][/color:189fi1h2]

cvv number
[color=#FF0000:189fi1h2]//*[@id="cvv-no"][/color:189fi1h2]

name on the card
[color=#FF0000:189fi1h2]//*[@id="card-name"][/color:189fi1h2]

and month and year
[color=#FF0000:189fi1h2]//*[@id="exp-dt-mt"]
//*[@id="exp-dt-yr"][/color:189fi1h2]


M
Replied on 15/06/2016

I had tried still not working


M
Replied on 15/06/2016

is any error coming? send a screenshot.


M
Replied on 18/06/2016

"org.openqa.selenium.NoSuchElementException: Unable to locate element <identifier>" with given identifier.

Plz try with project what deepak attached in initial thread by changing xpath of your's choice . I am also interested to know since it didn't work for me also.


M
Replied on 18/06/2016

can you give me the code sidhant. that you're using.


M
Replied on 19/06/2016

I have attached the project here, however there is not much changed in project given by deepak.


M
Replied on 20/06/2016

i couldn't understand your project. are you switching frame any where in the project?

because that Card number etc. are in an iframe?


M
Replied on 20/06/2016

Ohh Yes! I just didn't notice there is one iframe too. Thanks !!

Its working now.