Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
282 views
by
Hi there,

I am able to select and show only one email item on gmail but do not know yet how to click on that item. I tried the Console but not able yet.

Thanks

Dimos
by The go-to Tester (181 points)
Can you share your code and error as well??
by
Hi Mayur,
I am using Chrome gmail and need to click to email message and see its contents. I know how to filter it and but not sure how to use JavaScript/jQuery to click on the shown item. I was looking for a gmail api that I can use with JavaScript. There are no errors just an action to click on the the email body. I am also looking into Google Gmail Api for possible ideas.

Thanks
Dimos

1 Answer

0 like 0 dislike
by The go-to Tester (181 points)

From your comment I understood that you're looking for a JavaScript click event.

Say, below is your HTML element.

<input type="checkbox" id="myChkBox" onmouseover="myFn()" onclick="alert('Clicked!')">

 

You can click by below function.

<script>
function myFn() { //This function will be invoked while you mouse over an element
    document.getElementById("myChkBox").click(); // This function will click on the element
}
</script>

 

Hope that helps. Feel free to reply with your comment.

by
Thank you again for your time. I know how to reproduce the click event with Selenide but my question is that I do not really know the ID of the row during runtime since it's a dynamic id naming process. The gmail message displays a label Inbox and I need to get its ID. I think I'm almost there by using loop and filtering.
by The go-to Tester (181 points)
Yes, loop and filtering is something we need to do when we are dealing with rows. Try that and let me know if you are stuck.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...