Articles on Trending Technologies

Technical articles with clear explanations and examples

How to install Selenium WebDriver on Mac OS?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 30-Nov-2020 3K+ Views

We can install Selenium on Mac OS. We shall take the help of Homebrew package manager for installation in Mac OS. Let us follow the step by step process −Install Selenium by running the command −pip install seleniumInstall the Chrome driver with the homebrew by running the command −brew cask install chromedriverVerify the version of the Chrome driver, by running the command −chromedriver −−versionCreate a test script and try to execute after save.from selenium import webdriver # driver initialization driver = webdriver.Chrome(executable_path="C:\chromedriver.exe") # launch URL driver.get("https://www.tutorialspoint.com/index.htm")If the below error is triggered −unknown error: cannot find chrome binaryIt means the version ...

Read More

Capturing JavaScript error in Selenium.

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 30-Nov-2020 2K+ Views

We can capture Javascript error in Selenium. This type of error appears at the Console Tab on opening the Developer tools in the browser. This can occur due to some functional issue in the page or due to extra logs which may cause performance issues.We can handle the Javascript errors with the driver object and manage method.Exampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.List; import java.util.ArrayList; import org.openqa.selenium.logging.LogEntries; import org.openqa.selenium.logging.LogEntry; import org.openqa.selenium.logging.LogType; import java.util.logging.Level; import java.util.Set; public class JavascrptLogErs{    public static void main(String[] args) {       System.setProperty("webdriver.chrome.driver",       "C:\Users\ghs6kor\Desktop\Java\chromedriver.exe");       WebDriver ...

Read More

Switch tabs using Selenium WebDriver with Java.

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 30-Nov-2020 14K+ Views

We can switch tabs using Selenium. First we have to open a link in a new tab. The Keys.chord method along with sendKeys is to be used. The Keys.chord method allows you to pass more than one key at once. The group of keys or strings are passed as arguments to the method.We shall pass Keys.CONTROL and Keys.ENTER as arguments to the Keys.chord method. The whole string is then passed as an argument to the sendKeys method. Finally, the sendKeys method has to be applied on the link which is identified by driver.findElement method.SyntaxString clickl = Keys.chord(Keys.CONTROL, Keys.ENTER); driver.findElement(By.xpath("//*[text()='Terms of ...

Read More

Capturing browser logs with Selenium WebDriver using Java.

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 30-Nov-2020 1K+ Views

We can capture browser logs with Selenium. We have to type cast the RemoteWebDriver to driver and then initialize it. Next, we have to use the setLogLevel method. The import org.openqa.selenium.remote.RemoteWebDriver statement needs to be added in code for the RemoteWebDriver.Syntax((RemoteWebDriver) driver).setLogLevel(Level.INFO);Exampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.remote.RemoteWebDriver import java.util.logging.Level; public class BrwLogs{    public static void main(String[] args) {       System.setProperty("webdriver.chrome.driver",       "C:\Users\ghs6kor\Desktop\Java\chromedriver.exe");       WebDriver driver = new ChromeDriver();       // Enable logging with setLogLevel method       ((RemoteWebDriver) driver).setLogLevel(Level.INFO);       driver.get("https://www.tutorialspoint.com/index.htm");       ...

Read More

Why do we use WebDriver instead of Selenium IDE?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 30-Nov-2020 489 Views

We can use webdriver instead of Selenium IDE. The Selenium IDE is a record and playback tool but not dependable. The web elements which are dynamic cannot be handled well with Selenium IDE.Selenium IDE can be used for an easy solution to automation, but for a full regression suite, Selenium webdriver should be used. Some of the differences between Selenium IDE and Selenium webdriver are −Sl. No.Selenium IDESelenium Webdriver1.It supports only Firefox.It supports all the major browsers.2.Simply a record and playback tool.Not a record and playback tool.3.Architecture based on Javascript.Architecture not based on Javascript. Communicates with browser applications.4.Does not support ...

Read More

How to wait for options in a select to be populated in Selenium?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 30-Nov-2020 3K+ Views

We can wait for options in a select tag to be populated with Selenium. This can be done with the explicit wait concept in synchronization. The explicit wait is designed on the expected condition for an element.To wait for the options, we shall verify if presenceOfNestedElementsLocatedBy is available within the explicit wait time. We shall implement the entire verification within the try catch block.Let us see if the options are available for selection in the Continents dropdown. The ExpectedCondition along with WebDriverWait is used for explicit wait.HTML code of the select dropdown.Exampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import ...

Read More

Example of SQL query describing the conditional processing

Mandalika
Mandalika
Updated on 30-Nov-2020 311 Views

Problem: Write a SQL query to display 2 columns. First column should have ORDER_ID, the second column should give the value as YES/NO for free shipping based on ORDER_TOTAL > 500.SolutionThe query to display ORDER_ID and free shipping result based on the ORDER_TOTAL criteria can be written as below.ExampleSELECT ORDER_ID,    CASE WHEN ORDER_TOTAL > 500 THEN ‘YES’       ELSE ‘NO’ AS FREE_SHIPPING    END FROM ORDERSWe will use CASE expressions through which we can implement a logic to check the ORDER_TOTAL. If the ORDER_TOTAL is greater than 500 then we will get ‘YES’ for the free shipping ...

Read More

Investigation of root cause and resource responsible for the deadlock in DB2

Mandalika
Mandalika
Updated on 30-Nov-2020 2K+ Views

Problem: A COBOL-DB2 program failed due to deadlock. How will you find the resource due to which the program failed?SolutionA DEADLOCK condition occurs when two or more applications are stuck, waiting for each other to release the locks on the resources needed by them. A detailed information and logs can be found in the DB2 system job DSNZMSTR job. The DSNZ is the name of the installed DB2 sub-system and it can vary from installation to installation. The SYSOUT of this job continues to display the DB2 level system logs. The logs related to the deadlock are also available in ...

Read More

Explain the concept of LOCK PROMOTION with the help of an example

Mandalika
Mandalika
Updated on 30-Nov-2020 806 Views

A DB2 LOCK PROMOTION is defined as the process of acquiring more restrictive locks on a particular resource. DB2 uses LOCK PROMOTION for the concurrent processes which are trying to access the same DB2 resource. Basically, there are three types of locks.Shared lock(S)The concurrent processes can place a shared lock on a resource (DB2 table, row, page, etc) but cannot update the data. In order to update the data, concurrent processes have to promote their lock to UPDATE.Update lock(U)The concurrent process can read the data but cannot update it. Update lock indicates that the process is ready to update the ...

Read More

Implementation and purpose of direct index look-up

Mandalika
Mandalika
Updated on 30-Nov-2020 244 Views

The direct index look-up is chosen by the DB2 optimizer when all the columns used in the predicate of the WHERE clause is part of the index.For example, if we have ORDERS DB2 table as below.ORDER_IDORDER_DATEORDER_TOTALZ2234530-10-2020342Z3341214-08-2020543Z5699019-10-2020431Z5690221-09-20206743Z9978104-11-2020443Z5611229-08-2020889In this table, there is one index which is built having columns named ORDER_ID and ORDER_DATE. For the below query, DB2 optimizer will choose direct index look-up because the columns used in the SELECT statement are also part of the index.ExampleSELECT ORDER_ID, ORDER_DATE, INVOICE_ID FROM ORDERS    WHERE ORDER_ID = ‘Z33412’ AND ORDER_DATE = ‘14-08-2020’The result of the above query will be as follows.ORDER_IDORDER_DATEZ3341214-08-2020In the ...

Read More
Showing 44261–44270 of 61,248 articles
Advertisements