We had to make a project presentation in which we (as in me and my friend) had to conduct an additional survey to back up our point.
Now, like any other student, we waited till the deadline. Well, to be fair, we didn’t have a choice. We had a lot of work from college. But that’s the story of any student, I guess.
A snap of the form which was used to collect the information
So, we sent the link and got back a few responses. But, since the deadline was the next day and the survey had to be on a larger scale, I decided to create a bot for it. (Because that’s the obvious answer for everything. [Pun intended]).
Here it is:
• Link to the Code
A few things which I learnt are that while using the click() method, if we’re using xpath, it’s not easy for the web driver to locate a clickable element if it’s embedded under div tags and span tags. It throws a “no such element exception”. The best thing to do would be:
• Use the label of the element you want to locate on the form.
• To use the pre-filled links feature of Google forms. (Basically a pre-filled link, which uses parameters to fill the form). Best suited for small forms.