Tag Archives: selenium webdriver

Different Between close() and quit() Functions in Selenium Webdriver

In Selenium, after you start a browser(by Webdriver object) you need to close it. For this purposes there are two methods. close() and quit() What is different between them? İ see most example with close() and someone with quit(). Actually, they are almost similar and destroy web browser objects. Only different is: close() destroy current… Read More »

Take Screenshot with Selenium Webdriver

You can take screenshot of browser with browser. Python: you can use get_screenshot_as_file(path_to_save). # -*- coding: UTF-8 -*- import unittest from selenium import webdriver class TestClass(unittest.TestCase):     def setUp(self):         self.driver = webdriver.Firefox()          def test_MahsumAkbasNet_Pass(self):                  self.driver.get(“http://www.mahsumakbas.net/selenium”)                  self.driver.save_screenshot(“D:\\python_selenium_screenshot.jpg”)              def tearDown(self):         self.driver.quit() if __name__… Read More »

Run Selenium Scripts with Jenkins CI

You write your automation script, they are working perfectly anf got perfect result. But, will you run script everytime manually? Solution is Continuous Integration tools. Most known is Jenkins. Let’s setup a job to run our test. Open Jenkins homepage Click on New Item link at left-top corner Because of we have a simple python… Read More »

Selenium Webdriver – Run Javascript in Python

Selenium Webdriver provide a way to run(call) Javascript code in your test. There is a Javascript execution function for each language. For Python, this function is execute_script(code). you can see a basic usage of this function at below. After run it, you can see alert pop up with. also, you can see that appeared pop… Read More »

Selenium Webdrvier – Wait jQuery Ajax Request Complete in Python

if you have a jQuery Ajax request in your test web page, you should wait to request to complete. Otherwise, unexpected behaviours can occur. in Selenium Webdriver, we can perform by Javascript running function: execute_script() jQuery provide a parameter to check request status. “active” is one of jQuery library. if value is 1 it means… Read More »