Selenium IDE can't understand Right-Click Event

vu nam
vu nam used Ask the Experts™
on
Selenium IDE

I want to test Firefox Web

1 / Click Event : Selenium Understand it
2 / Right-Click Event : Selenium can't

Anyone knowledge help to solve it

Thank
Nam
Email : phuongnamvu@gmail.com
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
vu namTester

Author

Commented:
RightClick.jpg
Craig KehlerDirector of Customer Relations
Commented:
I think you've hit the limitations of the IDE. I can't find any context menu or right click commands in the IDE. This can be done via webdriver. https://www.dev2qa.com/selenium-webdriver-how-to-perform-right-click/ 

From the screen shot you may be able to inspect that element and access it directly even if it's currently hidden, working around the right click event need.
vu namTester

Author

Commented:
Hi CK

Selenium Webdriver is Good . I follow to your metor carefully

1/ Right Click on Screen : OK

WebElement element = driver.findElement(By.id("tabscontent:tabView:BWconent_0:treeLeft_0:1:j_idt614"));
Actions action = new Actions(driver);
//Perform Right click operation using action (object) on element using contextClick method.
action.contextClick(element).perform();


2/ Click " Nouveau "  : Not OK
   ( Only one Option : New )

I try try try to Find @class for "Nouveau " Option : Click . But not work

Something like that :
driver.findElement(By.xpath("//*[@class='ui-menuitem-text']")).click();


Please to see my video
bandicam-2018-10-31-16-16-50-957.avi
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

vu namTester

Author

Commented:
Hi CK

After Right-Click is Good
I need to Click first Option ( "Nouveau" )

How can I do ?


@class for "Nouveau" Option  in Image ( Please to see )
Craig KehlerDirector of Customer Relations
Commented:
Hi Vu,

Glad to hear you got past the right click. Now for the follow up question.

It is very difficult to determine locators from a video and it looks like this is a private use site, so I'm guessing I won't get to see the source and interact with it :).
Have you tried the sendKeys commands to mimic the arrow key and enter inputs once the context menu is open? That is also shown in that original tutorial I linked.

In general I highly recommend honing your skills on how to properly select elements. Doing this in a uniform way will greatly help your code maintenance in the future. I tend to favor locating by ID as it seems the least likely to change, but that all depends on how they typically modify the web page you are automating.

Check out this article on how to determine selectors. https://www.experts-exchange.com/articles/28259/Use-CSS-Selectors-to-Locate-WebElements-with-Selenium-WebDriver.html

Regards,

Craig
Tester
Commented:
Oh Yeah . That great Job

I can do it well done
Thanks you so much

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial