Mouse Click Failed to execute


#1

I am trying to create a record to click the image using xpath or coordinates but it does not work.
It just failed saying an error mouse click failed.

//*[@class='pd_img_wrpr'][2]//span[2]
//*[@class='pd_img_wrpr'][3]//span[2]

I also tried using coordinates but it does not work either.


#2

@rene_naidas,

please add full description with links, your sample recording, screenshots, etc


#3

step 38 Failed at the mouse click action

Test_Practice_3.zip (116.9 KB)


#4

@rene_naidas,

please post the exact page URL where you need to find the given XPath, because your recording cannot be played on other PCs (excel file missing, images specific to your system)


#5

#6

the given URL (www.fairprice.com.sg) does not contain elements matching the following XPAths:

//*[@class='pd_img_wrpr'][2]//span[2]
//*[@class='pd_img_wrpr'][3]//span[2]

please provide the exact URL.

For example:
http://www.fairprice.com.sg/webapp/wcs/stores/servlet/SearchDisplay?searchTerm=butter&categoryId=&storeId=10001&catalogId=10051&langId=-1&pageSize=24&beginIndex=0&sType=SimpleSearch&resultCatEntryType=2&showResultsPage=true&searchSource=Q&pageView=


#7

http://www.fairprice.com.sg/webapp/wcs/stores/servlet/SearchDisplay?searchTerm=salted+butter&categoryId=&storeId=10001&catalogId=10051&langId=-1&pageSize=24&beginIndex=0&sType=SimpleSearch&resultCatEntryType=2&showResultsPage=true&searchSource=Q&pageView=


#8

this page does not contain elements with pd_img_wrpr class.

please post an image of the element which you want to click.


#9

Hi Azinchuk,

Thank you for your assistance.
Kindly refer to my attachment.

When I click the first pic it works but for the second one it does not work.

Page.pdf (448.6 KB)


#10

got you, this class is shown only when the List View is on.

So the valid XPaths should look like this:

//*[@class='pro_list'][1]/*[@class='pd_img_wrpr']//span[2]
//*[@class='pro_list'][2]/*[@class='pd_img_wrpr']//span[2]
...
//*[@class='pro_list'][${counter}]/*[@class='pd_img_wrpr']//span[2]

But actually these span elements have no content

It is better to click on a link element :

//*[@class='pro_list'][1]/*[@class='pd_img_wrpr']/a

#11

Hi Azinchuk,

I checked and an error was the same.
//[@class=‘pro_list’][1]/[@class=‘pd_img_wrpr’]/a

previously using this
//*[@class=‘pd_img_wrpr’][1]//span[2] at the first image I can go to the product info

but the second picture it does not work any more.


#12

You’ve missed the * symbol before [@class]


#13

//[@class=‘pro_list’][1]/[@class=‘pd_img_wrpr’]//span[1]

mouse click action for the above xpath it goes to the next weblink

//[@class=‘pro_list’][2]/[@class=‘pd_img_wrpr’]//span[1]

mouse click action for the above xpath failed

Error still the same. Any other option?


#14

@rene_naidas, your xpath is wrong. You need to set the element tag or * before square brackets:

//*[@class='pro_list'][1]/*[@class='pd_img_wrpr']/a

#15

Hi Azinchuk,

Yes the XPATH was the same. Anyway the xpath //[@class=‘pro_list’][1]/[@class=‘pd_img_wrpr’]/a
It supposed to click the Xpath but it does not resulting to an error message.


#16