Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error message and dump record to a text file #13

Closed
Nanparam opened this issue Aug 26, 2018 · 1 comment
Closed

Add error message and dump record to a text file #13

Nanparam opened this issue Aug 26, 2018 · 1 comment

Comments

@Nanparam
Copy link

Just minor revision from your codes after clicking submit button, so any error message will be captured alongside with username into firebase db and dump it also to a text file :
.................
submit.click()
sleep(3)
try:
alert = driver.find_element_by_xpath("//*[@ROLE='alert']")
alert = alert.text
except:
alert=""
pass

                        print('Registering....'+name+','+alert)
                        try:
                            with open('storedDB.txt', 'a') as outcsv:
                                writer = csv.writer(outcsv, delimiter=';', quotechar='"', quoting=csv.QUOTE_NONE, lineterminator='\n')
                                #text = name+','+alert
                                #print(text )
                                writer.writerow([name, alert])
                            outcsv.close()
                        except:
                            pass
                        storeinfirebase(name,alert)

                        sleep(10)
                        driver.close()
                        if "Sorry" in alert:
                            return True

..........
..........
..........
...........
...........
...........

for i in range(0, config.Config['amount_of_run']):
if create_account():
break

@FeezyHendrix
Copy link
Owner

Hi, Thank you very much. Kindly create a pull request so I can easily update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants