Click 3dots webpage item

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Click 3dots webpage item

Post by drunkenmonkey » Fri Oct 29, 2021 2:55 pm

Hi!
With chromdriver use I can automate a website. But what I have difficulty is to click this 3dots item at the right side. When clicking on it opens a popup menu.

Here's the images link.
https://u.pcloud.link/publink/show?code ... 1rx8HYP4Qy

Item code inspector

Code: Select all

<img ng-click="showIconsPopup(webcast, $index)" onclick="MoreIconClicked(this);" class="popupTriggerElement" src="/view/wccpro/newui/images/ic_more_vert_black_24px.svg" alt="More" title="More" style="margin:0 0 0 -5px;">
With the popup.
https://u.pcloud.link/publink/show?code ... f70kaExer7

Item code inspector

Code: Select all

<span class="labell">Reports</span>
Can you help me with the ChromeFindElements and ChromeElementAction commands?

Thank you!

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Click 3dots webpage item

Post by Dorian (MJT support) » Fri Oct 29, 2021 6:23 pm

I'd try these and use whichever result wasn't 0.

Code: Select all

ChromeFindElements>session_id,xpath,//img[@alt='More'],el
mdl>el_count
//ChromeElementAction>session_id,el_1,click

ChromeFindElements>session_id,xpath,//img[@title='More'],el2
mdl>el2_count
//ChromeElementAction>session_id,el2_1,click

ChromeFindElements>session_id,xpath,//img[@src='/view/wccpro/newui/images/ic_more_vert_black_24px.svg'],el3
mdl>el3_count
//ChromeElementAction>session_id,el3_1,click
For "reports", this should find it once you've clicked the dots, you'll just need to make sure you get the correct Span

Code: Select all

ChromeFindElements>session_id,tag name,span,el4
mdl>el4_count
If they are all 0, check it's not in a frame.
Yes, we have a Custom Scripting Service. Message me or go here

drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Re: Click 3dots webpage item

Post by drunkenmonkey » Fri Oct 29, 2021 8:15 pm

Thank you Dorian for helping.
Second and Third ChromeFindElements =1 but the ChromeElementAction does not seem to do something because the popup is not displayed.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Click 3dots webpage item

Post by Dorian (MJT support) » Fri Oct 29, 2021 8:45 pm

If you want to send us the login details we'll happily look at it for you in detail. Don't forget you could also use Image Recognition if all else fails.
Yes, we have a Custom Scripting Service. Message me or go here

drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Re: Click 3dots webpage item

Post by drunkenmonkey » Sat Oct 30, 2021 11:37 am

Thank you again for your help,
I have managed let it worked. The popup open.
But for the span to access the report I need help.

Here's the code.

Code: Select all

<span class="labell">Reports</span>

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Click 3dots webpage item

Post by Dorian (MJT support) » Sat Oct 30, 2021 1:17 pm

Was el4_count 0?

And did you leave enough time for it to open?

One thing to note is that once you know it's clicking on Reports you might be able to click it without even needing to click the 3 dots.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Click 3dots webpage item

Post by Dorian (MJT support) » Sat Oct 30, 2021 1:18 pm

Or can you find out the URL reports navigates to and just navigate there?
Yes, we have a Custom Scripting Service. Message me or go here

drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Re: Click 3dots webpage item

Post by drunkenmonkey » Sat Oct 30, 2021 1:28 pm

Thank You again for your answers.
I managed to open the Reports by simply sending a Tab and Enter keystroke and
the report page open in a new tab.
With this code I could not find the Reports element of the popup.
ChromeFindElements>session_id,tag name,Reports,el4
the var is 0
Like you ask, the waiting time is important and I did adjust it to let it open
the popup.
:D :D :D :D

drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Re: Click 3dots webpage item

Post by drunkenmonkey » Sat Oct 30, 2021 2:05 pm

If I may ask a question regarding the data processing of that
report page. It may take several seconds before the processing finish.
How do I make sure it is finish. The wait command may not be enough.

Thank you again Dorian!

:D :D :D

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Click 3dots webpage item

Post by Dorian (MJT support) » Sat Oct 30, 2021 2:15 pm

The chrome functions are generally pretty good at waiting for completion. I've rarely needed a wait of more than a couple of seconds afterwards.

However, if you want to make sure *something* has loaded.. And it's not always the obvious element you're looking at, you can use ChomeFindElements in a while/endwhile loop, while the result count is 0. This means it will keep looping and looking for an element until the count isn't 0 and has therefore been found. Just remember to set the result count to 0 just before the loop.
Yes, we have a Custom Scripting Service. Message me or go here

drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Re: Click 3dots webpage item

Post by drunkenmonkey » Sun Nov 21, 2021 11:11 am

Hi Dorian!
Thank you for your suggestion.
I tried this code but no success.

Code: Select all

ChromeFindElements>session_id,xpath,//span[@id='lblAttendeeCount'],lblAttCount

Let>x=ChromeFindElements>session_id,xpath,//span[@id='lblAttendeeCount'],lblAttCount
Let>x=0

While>x=%lblAttCount%_1

  Let>x=x+1
  mdl>%lblAttCount%
EndWhile
Can you point me to what am I doing wrong.
Thank you again for your help.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Click 3dots webpage item

Post by Dorian (MJT support) » Sun Nov 21, 2021 12:20 pm

If you're just waiting for an element to load, it would be something more like this :

Code: Select all

let>lblAttCount_Count=0
while>lblAttCount_Count<1
ChromeFindElements>session_id,xpath,//span[@id='lblAttendeeCount'],lblAttCount
Endwhile
Yes, we have a Custom Scripting Service. Message me or go here

drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Re: Click 3dots webpage item

Post by drunkenmonkey » Sun Nov 21, 2021 6:06 pm

Thank you Dorian for your answer.
here's the result.
https://u.pcloud.link/publink/show?code ... 44SR08hHvy
https://u.pcloud.link/publink/show?code ... 8YvXNc9UO7

If I run outside the loop with a waiting time of 20 the count show 3. The el I'm looking for is 1.

thank you again for your help!

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Click 3dots webpage item

Post by Dorian (MJT support) » Sun Nov 21, 2021 9:30 pm

So if you just run this, lblAttCount_Count is 3? .. :

Code: Select all

ChromeFindElements>session_id,xpath,//span[@id='lblAttendeeCount'],lblAttCount
..But if you run this, you get the Json error? :

Code: Select all

let>lblAttCount_Count=0
while>lblAttCount_Count<1
ChromeFindElements>session_id,xpath,//span[@id='lblAttendeeCount'],lblAttCount
Endwhile
Hmm, that's odd, if everything else is the same and if session_id is correct.

I wonder if it's that the loop is too tight and it's overwhelming something?

What if you try this? :

Code: Select all

let>lblAttCount_Count=0
while>lblAttCount_Count<1
ChromeFindElements>session_id,xpath,//span[@id='lblAttendeeCount'],lblAttCount
Wait>2
Endwhile
Yes, we have a Custom Scripting Service. Message me or go here

drunkenmonkey
Pro Scripter
Posts: 90
Joined: Fri Jan 31, 2020 10:52 am

Re: Click 3dots webpage item

Post by drunkenmonkey » Mon Nov 22, 2021 10:03 am

Hi Dorian!
The wait command stop the Json error.
The script does not produce anything until I stop it.
Thank you for your help!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts