Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99411

Selenium closes window immediately

$
0
0

This is my first selenium test and i'm doing kahoot bot. Problem is this. When I open new window, selenium closes it immediately. I'm writing this in python, and using chrome. I've tested to change browser to firefox, but it doesn't solve this. My code is here:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

kode = ""
i = 0

kode = input ("Enter Kahoot code: ")
bots = input ("How many players you want: ")

print (kode)
print (bots)

browser = webdriver.Chrome()
browser.get("http://kahoot.it/")
text = browser.find_element_by_id("game-input")
text.send_keys(kode)
text.send_keys(Keys.RETURN)
time.sleep(1)
name = selain.find_element_by_id("nickname")
name.send_keys(i)
name.send_keys(Keys.RETURN)

Thank you!


Viewing all articles
Browse latest Browse all 99411

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>