Initially Selenium IDE was used as a Firefox plugin. But the latest Selenium IDE version supports both Chrome and Firefox. For installation in Chrome, navigate to the below link −ttps://chrome.google.com/webstore/detail/seleniumide/mooikfkahbdckldjjndioackbalphokdThen click on Add to Chrome.Click on Add extension.Once installed, we shall get the below message as shown in the image −Also an icon gets created in the menu bar.Click on that icon, and the Selenium IDE gets launched with the below welcome screen.
Suppose you have two tables: marks and student_info. Examples are given below for the two respectivelynameroll_noperc_marksAniket1224Siddhi4565Yash2642Isha5687nameroll_noagegenderAniket1226MIsha5625FSiddhi4523FYash2625MNow, suppose your manager at work looks at the two tables and tells you, “Why do we have two tables? Simplify things, shift everything to one table!”So you decide to add the perc_marks column to the student_info table.ALTER TABLE student_info ADD COLUMN perc_marks integerNow, how will you populate this column? Will you manually add the marks for each column? That will leave the room open for a lot of errors and will also be very time-consuming. Instead, this is what you could do −UPDATE student_info ... Read More
We can create nested test suites for Selenium IDE. A group of tests constitutes a test suite. First, to create a test suite we have to follow the below steps as listed below −Step1: Launch Selenium IDE. Then click on Create a new project link.Step2 − Provide the PROJECT NAME. Then click on OK.Step3 − Select Test Suites from the dropdown under the Project name. Then click on + button.Step4 − Add SUITE NAME, then click on ADD.Step5 − The new suite Test_Suite1 gets created. Click on it and select the option Add tests.Repeat the steps 3 and 4, to ... Read More
We can give manual input from the user while running Selenium IDE script. This can be done with the help of the Command, Target and Value steps given below −Step 1Command −execute scriptTarget −return prompt("Subject","");Value −InputStep 2Command −echoTarget −${Input}Click on Run current test as highlighted in the below image.OutputA prompt for user input comes up.The text Selenium Java is entered within the prompt.Selenium IDE log captures the text entered.
We can use and install Selenium IDE by following a few steps one by one. It is for integrated development of Selenium scripts. It is primarily used as an extension of Firefox.Some facts about Selenium IDE are listed below −Requires no technical knowledge of the testers.Record and playback feature available.Has the option to run either a single test case or all test cases in a suite.Allows usage of breakpoints for debugging.Auto−completion feature for commands in Selenium.Supports multiple locators like xpath, css, id, and so on.Tests can be saved in multiple formats like Python, C#, and so on.Initially used as a ... Read More
We can handle the situation in which the Firefox is not responding with the help of the Selenium webdriver in Python. This can be achieved with the help of the FirefoxProfile class.We shall create an object of this class and apply the set_preference method on it. Then pass these preferences − dom.max_script_run_time and dom.max_chrome_script_run_time with their values set to 0 as parameters to that method.Finally, this information shall be sent to the webdriver object.Syntaxf = webdriver.FirefoxProfile() f.set_preference("dom.max_chrome_script_run_time", 0) f.set_preference("dom.max_script_run_time", 0)We can get the above parameters of the browser by following the below steps −Open the Firefox browser.Type about:config in browser ... Read More
The ability to define JSON columns in PostgreSQL makes it very powerful and helps PostgreSQL users experience the best of both worlds: SQL and NoSQL.Creating JSON columns is quite straightforward. You just have to create/ define it like any other column and use the data type as JSON.Let us create a new table in PostgreSQL, called json_test −CREATE TABLE json_test( serial_no SERIAL PRIMARY KEY, name VARCHAR, metadata JSON );Now, let us populate it with some data −INSERT INTO json_test(name, metadata) VALUES ('Yash', '{"marks_scored":{"science":50, "maths":65}}'), ('Isha', '{"marks_scored":{"science":70, "maths":45}}');As you can see, the JSON values are added within single ... Read More
We can save a webpage with Selenium webdriver in Python. To save a page we shall first obtain the page source behind the webpage with the help of the page_source method.We shall open a file with a particular encoding with the codecs.open method. The file has to be opened in the write mode represented by w and encoding type as utf−8. Then use the write method to write the content obtained from the page_source method.Syntaxn = os.path.join("C:\Users\ghs6kor\Downloads\Test", "PageSave.html") f = codecs.open(n, "w", "utf−8") h = driver.page_source f.write(h)Let us make an attempt to save the below webpage −Examplefrom selenium import webdriver ... Read More
For understanding these concepts with examples, we will consider two tables, marks, and student_info, defined respectively below −marks −nameroll_noperc_marksSiddhi4565Yash2642Isha5687student_info −nameroll_noagegenderAniket1226MIsha5625FYash2625MAs you can see, the marks table doesn’t have an entry for Aniket, while the student_info table doesn’t have an entry for Siddhi. In other words, the marks table doesn’t have an entry for roll_no 12, while the student_info table doesn’t have an entry for roll_no 45. Now, let us understand the different JOINS one by one.INNER JOINIt returns only those rows for which entries are present in both the tables.SELECT marks.name, marks.roll_no, student_info.age FROM marks INNER JOIN student_info on marks.roll_no ... Read More
Selenium can use multi−threading in one browser with the help of TestNG framework. TestNG provides the feature of parallel execution which works on the concept of Java multi−threading.To execute tests based on various parameters, the TestNG has an XML file where we have the configurations. The attributes parallel and thread−count are used for parallel execution.The parallel attributes can have the following values −Classes − to execute all tests in a class within a one thread.Instances − to execute all methods in the same instance within one thread.Tests − to execute all methods in the same tag within one thread.Methods − ... Read More