Double click then modal page will show

18 views
Skip to first unread message

Cris Carlo Dapitanon

unread,
Jan 17, 2023, 5:47:54 AM1/17/23
to seleniu...@googlegroups.com
Hi, Expert

I have an issue showing the modal page after double-clicking the icon image. I ran the script below successfully without an error button, but the modal page did not show as expected.

Actual Result:
image.png
image.png
After the double click, nothing happens

Actions a = new Actions(driver);

a.moveToElement(driver.findElement(By.xpath("(//*[name()='image'])[1]"))).

doubleClick().

build().perform();


Expected Result:

image.png
After double click, the icon image -> Should show the page below
image.png


Thank you.


Best Regards,

Cris Carlo Dapitanon


Cris Carlo Dapitanon

unread,
Jan 17, 2023, 8:40:23 PM1/17/23
to ammar Khan, seleniu...@googlegroups.com
Hi, Ammar

I did you idea to remove the .build() and use JavascriptExecutor

JavascriptExecutor executor = (JavascriptExecutor) driver;

WebElement element = driver.findElement(By.xpath("(//*[name()='image'])[1]"));

executor.executeScript("arguments[0].dispatchEvent(new MouseEvent('dblclick', { bubbles: true }));", element);


Thank you.


Best Regards,

Cris Carlo Dapitanon




On Tue, Jan 17, 2023 at 7:22 PM ammar Khan <ammar...@yahoo.com> wrote:
Or may be use JavaScript executor for double click


On Tue, Jan 17, 2023 at 15:21, ammar Khan
Not sure if it'll help, but could you remove build action. Instead use perform only, as build is already included with .perform() now.

So basically your script is doing .build().build().perform()
--
You received this message because you are subscribed to the Google Groups "Selenium Experts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniumexper...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/seleniumexperts/CAH3%2BdxKg38ADbRTOsHYYA3dKVrK_on2aU7TFKU%3DiCzuw9fHMNw%40mail.gmail.com.

Cris Carlo Dapitanon

unread,
Jan 17, 2023, 8:42:09 PM1/17/23
to ammar Khan, seleniu...@googlegroups.com
Hi, Ammar

Thank you for your reply.

I did your idea to remove the .build() and use JavascriptExecutor

But still, the same modal page upon double did not show as expected 
image.png

JavascriptExecutor executor = (JavascriptExecutor) driver;

WebElement element = driver.findElement(By.xpath("(//*[name()='image'])[1]"));

executor.executeScript("arguments[0].dispatchEvent(new MouseEvent('dblclick', { bubbles: true }));", element);

image.png

Thank you.


Best Regards,

Cris Carlo Dapitanon


Cris Carlo Dapitanon

unread,
Jan 18, 2023, 3:14:53 AM1/18/23
to seleniu...@googlegroups.com


Thank you.


Best Regards,

Cris Carlo Dapitanon




---------- Forwarded message ---------
From: ammar Khan <ammar...@yahoo.com>
Date: Tue, Jan 17, 2023 at 7:21 PM
Subject: Re: {Selenium Experts} Double click then modal page will show
To: crisa...@gmail.com <crisa...@gmail.com>


Not sure if it'll help, but could you remove build action. Instead use perform only, as build is already included with .perform() now.

So basically your script is doing .build().build().perform()
On Tue, Jan 17, 2023 at 14:47, Cris Carlo Dapitanon
image.png
image.png
image.png
image.png
Reply all
Reply to author
Forward
0 new messages