Right click in Web browser

Hi team,

i am working in browser where i want to dowloand an image by right clicking on it .

and also tried with the following code
${image_url}= Get Element Attribute //*[@id=“__photo3-inner”]/div/img src

** log to console ${image_url}**

** Run Process curl -o ${id}.jpg ${image_url}**
by this able to download
but unable to open the image.

Does Get Element Attribute return valid url?

@raivo
Yeah it giving valid url only and i am getting image also but getting following error

If you manually open ling does it work? Can you share that link?

i can’t share that,
is there any activity to right click at any element in the browser ?

As in documentation >
with playwright:

Click    locator     button=right

With selenium:

Open Context Menu      locator

Keep in mind that with this approach you also need to handle keyboard actions and file dialogs are not part of browser

1 Like

Got it @raivo
Thank you

1 Like

Hey @raivo , with the above approach i am facing lot of exceptions, can you guide me with any other approach.

Best course of action would be to try to solve issue with downloading from url. That would be most resilient option.

but with that i am unable to get image
even i am getting the correct url

If given url works manually then there is an issue with your code. You can try using RPA.HTTP instead of curl. Without any knowledge of target application and its structure its difficult to propose any approaches.

2 Likes