Crissal1995 / automsr

MIT License
7 stars 0 forks source link

Changed Search generation mechanism and added a new SearchGenerator interface #60

Closed Crissal1995 closed 1 year ago

Crissal1995 commented 1 year ago

Closes #58 .

A new option is added to the config.yaml: automsr/search_type of value string enum. The valid options are random (default if the attribute is missing) or lorem, the option that enables the new search generator as described below.

A new search generator was added, FakerSearchGenerator. As the name implies, it uses the library Faker to both generate a random time to sleep, and a valid sentence to search of 6 words (more or less; see variable_nb_words=True).

Also, now the characters are not sent to the input text field at once, but they are sent one by one with selenium.ActionChains. This is still compatible with the old RandomSearchGenerator, since also a backspace is a valid key to send to a text field.

Another change is the time to sleep; it is now a generator too, so its value can be changed based on some requirements.