This is a migrated thread and some comments may be shown as answers.

Automating a sent email using gmail.

4 Answers 143 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 18 Sep 2013, 08:52 PM
I am attempting to automate the process of logging into gmail and sending an email out.  I am able to write a test with correct steps, but they are not working all of the time because gmail seems to have a dynamic id assignment.  The trouble I am having is after clicking compose, the "send to" field find logic is id=:8t, tagname=TextArea.  Other times the "send to" field is id=:86, tagname=TextArea, other times id=:92.  The results are, sometimes the test will work perfect and send the email, but other times it won't be able to find the "Send to" element after the "click compose email" step.

Do you have any suggestions as to how I should change the find logic on the "Send To" "Subject" and "Field" Elements of a composing email on gmail so that I can get a consistent element find?

4 Answers, 1 is accepted

Sort by
0
Mario
Telerik team
answered on 23 Sep 2013, 07:56 PM
Hello Doug,

Thank you for contacting Telerik Support.

When working with a scenario containing dynamic id's, we must take advantage of other properties which are unique to these elements. In the particular case of using Gmail I found the 'To' (textarea),  'Subject' (input) and 'Message Body' (div) fields could be located uniquely using the following properties respectively:

tagname=textarea
name=to
aria-label=Address

tagname=input
name=subjectbox
aria-label=Subject

tagname=div
role=textbox
aria-label=Message Body

If you set the corresponding find logic filters for the properties above, the To',  'Subject' and 'Message Body' fields should be found uniquely on each playback.

Let me know whether the suggestion helps.

Regards,
Mario
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Doug
Top achievements
Rank 1
answered on 25 Sep 2013, 09:14 PM
Thanks a lot.

I was able to find use this logic to find them.  I did have another, find logic working, but this is definitely cleaner.

I am having another issue however, I am trying to highlight all of the emails in the inbox and delete them.  I am successfully able to find the "highlight" all button checkbox, and the delete button using the find logic:

tagname = div
role = button
aria-label = Delete

However, the click command does not appear to actually click the button and carry through the delete action.  While watching the test, it appears the delete button gets highlighted when the delete click step comes up, but there is no action.   If I manually click the button during execution, it works fine.

Is there some sort of harder click I can employ than the click command?  You know, something that will automate clicking the mouse with 10 lbs of pressure instead of the normal 5lbs.  Just kidding, but you get the point.
0
Mario
Telerik team
answered on 26 Sep 2013, 10:01 PM
Hello Doug,

Glad to hear my suggestion was useful to you.

As for your issue with the delete button, try enabling the 'SimulateRealClick' property of this click step. If you were writing your script in code, enabling the property would be analogous to using the MouseClick() method to literally move the mouse and make a real click on the element as opposed to the Click() method which is considered a 'DOM-click'.

Let me know if it helps.

Regards,
Mario
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Doug
Top achievements
Rank 1
answered on 03 Oct 2013, 04:34 PM
Thanks a lot, that worked perfect.

I don't know why I hadn't thought of that before.
Tags
General Discussions
Asked by
Doug
Top achievements
Rank 1
Answers by
Mario
Telerik team
Doug
Top achievements
Rank 1
Share this question
or