How to use set_window_size method in elementium

Best Python code snippet using elementium_python

jxdork.py

Source:jxdork.py Github

copy

Full Screen

...24print(banner)25print(intro)26def Direcotorylist(a):27 browser=webdriver.Firefox(executable_path="./geckodriver")28 browser.set_window_size(900,900)29 browser.set_window_position(0,0)30 dork=('site:{} intitle:index.of'.format(a))31 browser.get("https://www.google.com/")32 cssselector=(".gLFyf")33 browser.find_element_by_css_selector(cssselector).send_keys(dork)34 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)35def Exposedconfig(a):36 browser=webdriver.Firefox(executable_path="./geckodriver")37 browser.set_window_size(900,900)38 browser.set_window_position(0,0)39 dork=('site:{} ext:xml | ext:conf | ext:cnf | ext:reg | ext:inf | ext:rdp | ext:cfg | ext:txt | ext:ora | ext:ini'.format(a))40 browser.get("https://www.google.com/")41 cssselector=(".gLFyf")42 browser.find_element_by_css_selector(cssselector).send_keys(dork)43 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)44def ExposedDatafiles(a):45 browser=webdriver.Firefox(executable_path="./geckodriver")46 browser.set_window_size(900,900)47 browser.set_window_position(0,0)48 dork=('site:{} ext:sql | ext:dbf | ext:mdb'.format(a))49 browser.get("https://www.google.com/")50 cssselector=(".gLFyf")51 browser.find_element_by_css_selector(cssselector).send_keys(dork)52 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)53def findwordpress(a):54 browser=webdriver.Firefox(executable_path="./geckodriver")55 browser.set_window_size(900,900)56 browser.set_window_position(0,0)57 dork=('site:{} inurl:wp- | inurl:wp-content | inurl:plugins | inurl:uploads | inurl:themes | inurl:download'.format(a))58 browser.get("https://www.google.com/")59 cssselector=(".gLFyf")60 browser.find_element_by_css_selector(cssselector).send_keys(dork)61 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)62def exposelogfiles(a):63 browser=webdriver.Firefox(executable_path="./geckodriver")64 browser.set_window_size(900,900)65 browser.set_window_position(0,0)66 dork=('site:{} ext:log | inurl:/9100'.format(a))67 browser.get("https://www.google.com/")68 cssselector=(".gLFyf")69 browser.find_element_by_css_selector(cssselector).send_keys(dork)70 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)71def Backupandold(a):72 browser=webdriver.Firefox(executable_path="./geckodriver")73 browser.set_window_size(900,900)74 browser.set_window_position(0,0)75 dork=('site:{} ext:bkf | ext:bkp | ext:bak | ext:old | ext:backup'.format(a))76 browser.get("https://www.google.com/")77 cssselector=(".gLFyf")78 browser.find_element_by_css_selector(cssselector).send_keys(dork)79 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)80def loginpages(a):81 browser=webdriver.Firefox(executable_path="./geckodriver")82 browser.set_window_size(900,900)83 browser.set_window_position(0,0)84 dork=('site:{} inurl:login'.format(a))85 browser.get("https://www.google.com/")86 cssselector=(".gLFyf")87 browser.find_element_by_css_selector(cssselector).send_keys(dork)88 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)89def sqlerror(a):90 browser=webdriver.Firefox(executable_path="./geckodriver")91 browser.set_window_size(900,900)92 browser.set_window_position(0,0)93 dork=('site:{} intext:"sql syntax near" | intext:"syntax error has occurred" | intext:"incorrect syntax near" | intext:"unexpected end of SQL command" | intext:"Warning: mysql_connect()" | intext:"Warning: mysql_query()" | intext:"Warning: pg_connect()"'.format(a))94 browser.get("https://www.google.com/")95 cssselector=(".gLFyf")96 browser.find_element_by_css_selector(cssselector).send_keys(dork)97 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)98def publiclyexposedoc(a):99 browser=webdriver.Firefox(executable_path="./geckodriver")100 browser.set_window_size(900,900)101 browser.set_window_position(0,0)102 dork=('site:{} ext:doc | ext:docx | ext:odt | ext:pdf | ext:rtf | ext:sxw | ext:psw | ext:ppt | ext:pptx | ext:pps | ext:csv'.format(a))103 browser.get("https://www.google.com/")104 cssselector=(".gLFyf")105 browser.find_element_by_css_selector(cssselector).send_keys(dork)106 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)107def phpinfo(a):108 browser=webdriver.Firefox(executable_path="./geckodriver")109 browser.set_window_size(900,900)110 browser.set_window_position(0,0)111 dork=('site:{} ext:php intitle:phpinfo "published by the PHP Group"'.format(a))112 browser.get("https://www.google.com/")113 cssselector=(".gLFyf")114 browser.find_element_by_css_selector(cssselector).send_keys(dork)115 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)116def Findingbackdor(a):117 browser=webdriver.Firefox(executable_path="./geckodriver")118 browser.set_window_size(900,900)119 browser.set_window_position(0,0)120 dork=('site:{} inurl:shell | inurl:backdoor | inurl:wso | inurl:cmd | shadow | passwd | boot.ini | inurl:backdoor'.format(a))121 browser.get("https://www.google.com/")122 cssselector=(".gLFyf")123 browser.find_element_by_css_selector(cssselector).send_keys(dork)124 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)125def Installsetup(a):126 browser=webdriver.Firefox(executable_path="./geckodriver")127 browser.set_window_size(900,900)128 browser.set_window_position(0,0)129 dork=('site:{} inurl:readme | inurl:license | inurl:install | inurl:setup | inurl:config'.format(a))130 browser.get("https://www.google.com/")131 cssselector=(".gLFyf")132 browser.find_element_by_css_selector(cssselector).send_keys(dork)133 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)134def openredirect(a):135 browser=webdriver.Firefox(executable_path="./geckodriver")136 browser.set_window_size(900,900)137 browser.set_window_position(0,0)138 dork=('site:{} inurl:redir | inurl:url | inurl:redirect | inurl:return | inurl:src=http | inurl:r=http'.format(a))139 browser.get("https://www.google.com/")140 cssselector=(".gLFyf")141 browser.find_element_by_css_selector(cssselector).send_keys(dork)142 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)143 144def apacherce(a):145 browser=webdriver.Firefox(executable_path="./geckodriver")146 browser.set_window_size(900,900)147 browser.set_window_position(0,0)148 dork=('site:{} ext:action | ext:struts | ext:do'.format(a))149 browser.get("https://www.google.com/")150 cssselector=(".gLFyf")151 browser.find_element_by_css_selector(cssselector).send_keys(dork)152 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)153def findpastebin(a):154 browser=webdriver.Firefox(executable_path="./geckodriver")155 browser.set_window_size(900,900)156 browser.set_window_position(0,0)157 dork=('site:pastebin.com {}'.format(a))158 browser.get("https://www.google.com/")159 cssselector=(".gLFyf")160 browser.find_element_by_css_selector(cssselector).send_keys(dork)161 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)162def employlinkden(a):163 browser=webdriver.Firefox(executable_path="./geckodriver")164 browser.set_window_size(900,900)165 browser.set_window_position(0,0)166 dork=('site:linkedin.com employees {}'.format(a))167 browser.get("https://www.google.com/")168 cssselector=(".gLFyf")169 browser.find_element_by_css_selector(cssselector).send_keys(dork)170 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)171def htaccess(a):172 browser=webdriver.Firefox(executable_path="./geckodriver")173 browser.set_window_size(900,900)174 browser.set_window_position(0,0)175 dork=('site:{} inurl:"/phpinfo.php" | inurl:".htaccess" | inurl:"/.git" google -github'.format(a))176 browser.get("https://www.google.com/")177 cssselector=(".gLFyf")178 browser.find_element_by_css_selector(cssselector).send_keys(dork)179 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)180def subdommains(a):181 browser=webdriver.Firefox(executable_path="./geckodriver")182 browser.set_window_size(900,900)183 browser.set_window_position(0,0)184 dork=('site:*.{}'.format(a))185 browser.get("https://www.google.com/")186 cssselector=(".gLFyf")187 browser.find_element_by_css_selector(cssselector).send_keys(dork)188 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)189def subsubdomain(a): 190 browser=webdriver.Firefox(executable_path="./geckodriver")191 browser.set_window_size(900,900)192 browser.set_window_position(0,0)193 dork=('site:*.*.{}'.format(a))194 browser.get("https://www.google.com/")195 cssselector=(".gLFyf")196 browser.find_element_by_css_selector(cssselector).send_keys(dork)197 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)198def findwordpress2(a):199 browser=webdriver.Firefox(executable_path="./geckodriver")200 browser.set_window_size(900,900)201 browser.set_window_position(0,0)202 dork=('site:{} inurl:wp-content | inurl:wp-includes'.format(a))203 browser.get("https://www.google.com/")204 cssselector=(".gLFyf")205 browser.find_element_by_css_selector(cssselector).send_keys(dork)206 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)207def wordpressWayback(a):208 browser=webdriver.Firefox(executable_path="./geckodriver")209 browser.set_window_size(900,900)210 browser.set_window_position(0,0)211 browser.get('http://wwwb-dedup.us.archive.org:8083/cdx/search?url={}/&matchType=domain&collapse=digest&output=text&fl=original,timestamp&filter=urlkey:.*wp[-].*&limit=1000000&xx='.format(a))212 213def Github(a):214 browser=webdriver.Firefox(executable_path="./geckodriver")215 browser.set_window_size(900,900)216 browser.set_window_position(0,0)217 browser.get('https://github.com/search?q=%22*.{}%22&type=host'.format(a))218 219def openbugbounty(a):220 browser=webdriver.Firefox(executable_path="./geckodriver")221 browser.set_window_size(900,900)222 browser.set_window_position(0,0)223 browser.get('https://www.openbugbounty.org/search/?search={}&type=host'.format(a))224 225def crossDomain(a):226 browser=webdriver.Firefox(executable_path="./geckodriver")227 browser.set_window_size(900,900)228 browser.set_window_position(0,0)229 browser.get('https://{}/crossdomain.xml'.format(a))230 231def ThreatCrowd(a):232 browser=webdriver.Firefox(executable_path="./geckodriver")233 browser.set_window_size(900,900)234 browser.set_window_position(0,0)235 browser.get('https://threatcrowd.org/domain.php?domain={}'.format(a))236 237def Swfgoogle(a):238 browser=webdriver.Firefox(executable_path="./geckodriver")239 browser.set_window_size(900,900)240 browser.set_window_position(0,0)241 dork=('inurl:{} ext:swf'.format(a))242 browser.get("https://www.google.com/")243 cssselector=(".gLFyf")244 browser.find_element_by_css_selector(cssselector).send_keys(dork)245 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)246def swfyandex(a):247 browser=webdriver.Firefox(executable_path="./geckodriver")248 browser.set_window_size(900,900)249 browser.set_window_position(0,0)250 browser.get('https://yandex.com/search/?text=site%3A{}+mime%3Aswf&lr=112509'.format(a))251 252def Swfwayback(a):253 browser=webdriver.Firefox(executable_path="./geckodriver")254 browser.set_window_size(900,900)255 browser.set_window_position(0,0)256 browser.get('https://web.archive.org/cdx/search?url={}/&matchType=domain&collapse=urlkey&output=text&fl=original&filter=urlkey:.*swf&limit=100000&_=1507209148310'.format(a))257def wayback3(a):258 browser=webdriver.Firefox(executable_path="./geckodriver")259 browser.set_window_size(900,900)260 browser.set_window_position(0,0)261 browser.get('https://web.archive.org/web/*/{}/*'.format(a))262def crtsh(a):263 browser=webdriver.Firefox(executable_path="./geckodriver")264 browser.set_window_size(900,900)265 browser.set_window_position(0,0)266 browser.get('https://crt.sh/?q=%25.{}'.format(a))267def shodan(a):268 browser=webdriver.Firefox(executable_path="./geckodriver")269 browser.set_window_size(900,900)270 browser.set_window_position(0,0)271 browser.get('https://www.shodan.io/search?query={}'.format(a))272def Bugbountpro(a):273 browser=webdriver.Firefox(executable_path="./geckodriver")274 browser.set_window_size(900,900)275 browser.set_window_position(0,0)276 dork=('site:{} inurl:/responsible disclosure'.format(a))277 browser.get("https://www.google.com/")278 cssselector=(".gLFyf")279 browser.find_element_by_css_selector(cssselector).send_keys(dork)280 browser.find_element_by_css_selector(cssselector).send_keys(Keys.ENTER)281print(Style.BRIGHT+Fore.RED+"[1] "+Style.BRIGHT+Fore.YELLOW+" Directory listing"+Style.BRIGHT+Fore.RED+" [2] "+Style.BRIGHT+Fore.YELLOW+"Exposed Configuration files")282print(Style.BRIGHT+Fore.RED+"[3] "+Style.BRIGHT+Fore.YELLOW+" Exposed Database files"+Style.BRIGHT+Fore.RED+" [4] "+Style.BRIGHT+Fore.YELLOW+"Find WordPress")283print(Style.BRIGHT+Fore.RED+"[5] "+Style.BRIGHT+Fore.YELLOW+" Exposed log files"+Style.BRIGHT+Fore.RED+" [6] "+Style.BRIGHT+Fore.YELLOW+"Backup and old files")284print(Style.BRIGHT+Fore.RED+"[7] "+Style.BRIGHT+Fore.YELLOW+" Login pages"+Style.BRIGHT+Fore.RED+" [8] "+Style.BRIGHT+Fore.YELLOW+"SQL errors")285print(Style.BRIGHT+Fore.RED+"[9] "+Style.BRIGHT+Fore.YELLOW+" Publicly exposed documents"+Style.BRIGHT+Fore.RED+" [10] "+Style.BRIGHT+Fore.YELLOW+"phpinfo()")286print(Style.BRIGHT+Fore.RED+"[11] "+Style.BRIGHT+Fore.YELLOW+"Finding Backdoors"+Style.BRIGHT+Fore.RED+" [12] "+Style.BRIGHT+Fore.YELLOW+"Install / Setup files")287print(Style.BRIGHT+Fore.RED+"[13] "+Style.BRIGHT+Fore.YELLOW+"Open Redirects"+Style.BRIGHT+Fore.RED+" [14] "+Style.BRIGHT+Fore.YELLOW+"Apache STRUTS RCE")288print(Style.BRIGHT+Fore.RED+"[15] "+Style.BRIGHT+Fore.YELLOW+"Find Pastebin entries"+Style.BRIGHT+Fore.RED+" [16] "+Style.BRIGHT+Fore.YELLOW+"Employees on LINKEDIN")...

Full Screen

Full Screen

ui.py

Source:ui.py Github

copy

Full Screen

...4 from selenium import webdriver5 from selenium.webdriver.common.keys import Keys6 from time import sleep7 browser = webdriver.Chrome(executable_path='./chromedriver')8 browser.set_window_size(1980, 1080)9 browser.set_window_position(0, 0)10 sleep(2)11 browser.get("http://chat.bekerina.com:3000/")12 sleep(3)13 browser.find_element_by_id("name-line").send_keys("vardas")14 sleep(2)15 browser.find_element_by_id("message").send_keys("labas")16 sleep(2)17 submit_button = browser.find_element_by_xpath('//*[@id="send"]')18 submit_button.click()19 self.assertIsNone(submit_button.click())20 sleep(3)21 browser.close()22 def test_enter_name(self):23 from selenium import webdriver24 from selenium.webdriver.common.keys import Keys25 from time import sleep26 browser = webdriver.Chrome(executable_path='./chromedriver')27 browser.set_window_size(1980, 1080)28 browser.set_window_position(0, 0)29 sleep(2)30 browser.get("http://chat.bekerina.com:3000/")31 sleep(3)32 browser.find_element_by_id("name-line").send_keys("vardas")33 sleep(2)34 submit_button = browser.find_element_by_xpath('//*[@id="send"]')35 submit_button.click()36 self.assertNotIn("vardas", "name-line")37 sleep(2)38 browser.close()39 def test_resize(self):40 from selenium import webdriver41 from selenium.webdriver.common.keys import Keys42 from time import sleep43 browser = webdriver.Chrome(executable_path='./chromedriver')44 browser.set_window_size(1980, 1080)45 browser.set_window_position(0, 0)46 sleep(2)47 browser.get("http://chat.bekerina.com:3000/")48 sleep(3)49 browser.set_window_position(500, 10)50 self.assertTrue(browser.set_window_position, (500, 10))51 browser.set_window_size(750, 808)52 self.assertTrue(browser.set_window_position, (750, 808))53 sleep(3)54 browser.close()55 def test_min_max(self):56 from selenium import webdriver57 from selenium.webdriver.common.keys import Keys58 from time import sleep59 browser = webdriver.Chrome(executable_path='./chromedriver')60 browser.set_window_size(1980, 1080)61 browser.set_window_position(0, 0)62 sleep(2)63 browser.get("http://chat.bekerina.com:3000/")64 sleep(4)65 browser.minimize_window()66 sleep(2)67 browser.maximize_window()68 sleep(2)69 self.assertEquals(browser.minimize_window(), browser.maximize_window())70 sleep(3)71 browser.close()72 def test_keys(self):73 from selenium import webdriver74 from selenium.webdriver.common.keys import Keys75 from time import sleep76 browser = webdriver.Chrome(executable_path='./chromedriver')77 browser.set_window_size(1980, 1080)78 browser.set_window_position(0, 0)79 sleep(2)80 browser.get("http://chat.bekerina.com:3000/")81 sleep(3)82 browser.find_element_by_id("name-line").send_keys("vardas")83 browser.find_element_by_id("send").send_keys(Keys.ENTER)84 sleep(2)85 self.assertNotEqual(browser.find_element_by_id("send").send_keys(Keys.ENTER), "")86 browser.close()87 def test_scroll(self):88 from selenium import webdriver89 from selenium.webdriver.common.keys import Keys90 from time import sleep91 browser = webdriver.Chrome(executable_path='./chromedriver')92 browser.set_window_size(1980, 1080)93 browser.set_window_position(0, 0)94 sleep(2)95 browser.get("http://chat.bekerina.com:3000/")96 sleep(3)97 browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")98 sleep(3)99 browser.execute_script("window.scrollTo(document.body.scrollHeight, 0);")100 self.assertEqual(browser.execute_script("window.scrollTo(document.body.scrollHeight, 0);"),101 browser.execute_script("window.scrollTo(0, document.body.scrollHeight);"))102 sleep(3)103 browser.close()104 def test_refresh(self):105 from selenium import webdriver106 from selenium.webdriver.common.keys import Keys107 from time import sleep108 browser = webdriver.Chrome(executable_path='./chromedriver')109 browser.set_window_size(1980, 1080)110 browser.set_window_position(0, 0)111 sleep(2)112 browser.get("http://chat.bekerina.com:3000/")113 sleep(3)114 browser.find_element_by_id("name-line").send_keys("vardas")115 browser.find_element_by_id("message").send_keys("labas")116 browser.find_element_by_id("name-line").send_keys("vardas")117 browser.find_element_by_id("message").send_keys("labas")118 browser.find_element_by_id("name-line").send_keys("vardas")119 browser.find_element_by_id("message").send_keys("labas")120 browser.find_element_by_id("name-line").send_keys("vardas")121 browser.find_element_by_id("message").send_keys("labas")122 browser.find_element_by_id("name-line").send_keys("vardas")123 browser.find_element_by_id("message").send_keys("labas")124 browser.find_element_by_id("name-line").send_keys("vardas")125 browser.find_element_by_id("message").send_keys("labas")126 browser.find_element_by_id("name-line").send_keys("vardas")127 browser.find_element_by_id("message").send_keys("labas")128 sleep(2)129 browser.refresh()130 self.assertNotEqual("vardas", "")131 sleep(2)132 browser.close()133 def test_send_message2(self):134 from selenium import webdriver135 from selenium.webdriver.common.keys import Keys136 from time import sleep137 browser = webdriver.Firefox(executable_path='./geckodriver')138 browser.set_window_size(1980, 1080)139 browser.set_window_position(0, 0)140 sleep(2)141 browser.get("http://chat.bekerina.com:3000/")142 sleep(3)143 browser.find_element_by_id("name-line").send_keys("vardas")144 sleep(2)145 browser.find_element_by_id("message").send_keys("labas")146 sleep(2)147 submit_button = browser.find_element_by_xpath('//*[@id="send"]')148 submit_button.click()149 self.assertIsNone(submit_button.click())150 sleep(6)151 browser.close()152 def test_enter_name2(self):153 from selenium import webdriver154 from selenium.webdriver.common.keys import Keys155 from time import sleep156 browser = webdriver.Firefox(executable_path='./geckodriver')157 browser.set_window_size(1980, 1080)158 browser.set_window_position(0, 0)159 sleep(2)160 browser.get("http://chat.bekerina.com:3000/")161 sleep(3)162 browser.find_element_by_id("name-line").send_keys("vardas")163 sleep(2)164 submit_button = browser.find_element_by_xpath('//*[@id="send"]')165 submit_button.click()166 self.assertNotIn("vardas", "name-line")167 sleep(2)168 browser.close()169 def test_resize2(self):170 from selenium import webdriver171 from selenium.webdriver.common.keys import Keys172 from time import sleep173 browser = webdriver.Firefox(executable_path='./geckodriver')174 browser.set_window_size(1980, 1080)175 browser.set_window_position(0, 0)176 sleep(2)177 browser.get("http://chat.bekerina.com:3000/")178 sleep(3)179 browser.set_window_position(500, 10)180 self.assertTrue(browser.set_window_position, (500, 10))181 browser.set_window_size(750, 808)182 self.assertTrue(browser.set_window_position, (750, 808))183 sleep(3)184 browser.close()185 def test_min_max2(self):186 from selenium import webdriver187 from selenium.webdriver.common.keys import Keys188 from time import sleep189 browser = webdriver.Firefox(executable_path='./geckodriver')190 browser.set_window_size(1980, 1080)191 browser.set_window_position(0, 0)192 browser.get("http://chat.bekerina.com:3000/")193 sleep(4)194 browser.minimize_window()195 sleep(4)196 browser.maximize_window()197 sleep(4)198 self.assertEquals(browser.minimize_window(), browser.maximize_window())199 browser.close()200 def test_keys2(self):201 from selenium import webdriver202 from selenium.webdriver.common.keys import Keys203 from time import sleep204 browser = webdriver.Firefox(executable_path='./geckodriver')205 browser.set_window_size(1980, 1080)206 browser.set_window_position(0, 0)207 sleep(2)208 browser.get("http://chat.bekerina.com:3000/")209 sleep(3)210 browser.find_element_by_id("name-line").send_keys("vardas").send_keys(Keys.ENTER)211 sleep(2)212 self.assertNotEqual(browser.find_element_by_id("send").send_keys(Keys.ENTER), "")213 sleep(2)214 browser.close()215 def test_scroll2(self):216 from selenium import webdriver217 from selenium.webdriver.common.keys import Keys218 from time import sleep219 browser = webdriver.Firefox(executable_path='./geckodriver')220 browser.set_window_size(1980, 1080)221 browser.set_window_position(0, 0)222 sleep(2)223 browser.get("http://chat.bekerina.com:3000/")224 sleep(3)225 browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")226 sleep(3)227 browser.execute_script("window.scrollTo(document.body.scrollHeight, 0);")228 self.assertEqual(browser.execute_script("window.scrollTo(document.body.scrollHeight, 0);"),229 browser.execute_script("window.scrollTo(0, document.body.scrollHeight);"))230 sleep(3)231 browser.close()232 def test_refresh2(self):233 from selenium import webdriver234 from selenium.webdriver.common.keys import Keys235 from time import sleep236 browser = webdriver.Firefox(executable_path='./geckodriver')237 browser.set_window_size(1980, 1080)238 browser.set_window_position(0, 0)239 sleep(2)240 browser.get("http://chat.bekerina.com:3000/")241 sleep(3)242 browser.find_element_by_id("name-line").send_keys("vardas")243 browser.find_element_by_id("message").send_keys("labas")244 browser.find_element_by_id("name-line").send_keys("vardas")245 browser.find_element_by_id("message").send_keys("labas")246 browser.find_element_by_id("name-line").send_keys("vardas")247 browser.find_element_by_id("message").send_keys("labas")248 browser.find_element_by_id("name-line").send_keys("vardas")249 browser.find_element_by_id("message").send_keys("labas")250 browser.find_element_by_id("name-line").send_keys("vardas")251 browser.find_element_by_id("message").send_keys("labas")...

Full Screen

Full Screen

test_selenium.py

Source:test_selenium.py Github

copy

Full Screen

...13url_2 = 'http://10.0.0.32:7456/' # 斗地主14def running_maj(url):15 browser_1 = webdriver.Chrome(executable_path='E:\GeckoDriver\chromedriver.exe')16 browser_1.get(url)17 browser_1.set_window_size(width=960, height=520, windowHandle='current')18 browser_1.set_window_position(y=0, x=0)19 browser_2 = webdriver.Chrome(executable_path='E:\GeckoDriver\chromedriver.exe')20 browser_2.get(url)21 browser_2.set_window_size(width=960, height=520, windowHandle='current')22 browser_2.set_window_position(y=0, x=970)23 browser_3 = webdriver.Chrome(executable_path='E:\GeckoDriver\chromedriver.exe')24 browser_3.get(url)25 browser_3.set_window_size(width=960, height=520, windowHandle='current')26 browser_3.set_window_position(y=521, x=0)27 browser_4 = webdriver.Chrome(executable_path='E:\GeckoDriver\chromedriver.exe')28 browser_4.get(url)29 browser_4.set_window_size(width=960, height=520, windowHandle='current')30 browser_4.set_window_position(y=521, x=970)31def running_ddz(url):32 browser_1 = webdriver.Chrome(executable_path='E:\GeckoDriver\chromedriver.exe')33 browser_1.get(url)34 browser_1.set_window_size(width=960, height=520, windowHandle='current')35 browser_1.set_window_position(y=0, x=0)36 browser_2 = webdriver.Chrome(executable_path='E:\GeckoDriver\chromedriver.exe')37 browser_2.get(url)38 browser_2.set_window_size(width=960, height=520, windowHandle='current')39 browser_2.set_window_position(y=0, x=970)40 browser_3 = webdriver.Chrome(executable_path='E:\GeckoDriver\chromedriver.exe')41 browser_3.get(url)42 browser_3.set_window_size(width=960, height=520, windowHandle='current')43 browser_3.set_window_position(y=521, x=521)44while True:45 try:46 game = int(input("请输入你想要打开的游戏:\n 1:血战麻将 \n 2:斗地主 \n"))47 if game == 1:48 running_maj(url_1)49 continue50 elif game == 2:51 running_ddz(url_2)52 continue53 else:54 print("请选择正确的游戏,后续游戏开发中...")55 except:56 print("请选择正确的游戏,后续游戏开发中...")

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run elementium automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful