Posted on Leave a comment

What is the difference between ChromDriver and WebDriver in Selenium?

One question which usually pops up among programmers is how to establish the difference between ChromDriver and WebDriver in Selenium for software testing. While both drivers are similar in terms of function and use, there are a few differences between them. This article will take you through these differences and settle all forms of doubts concerning the existence of a difference between ChromDriver and WebDriver in Selenium.

ChromDriver

ChromDriver can be characterized as an independent server that executes chromium’s WebDriver protocol. It is quite possible to create the object utilizing a subsequent command to instantiate the object of ChromeDriver if ChromeDriver driver=new ChromeDriver(); is created.

One of the obvious functions of the ChromeDriver is to initiate Google Chrome. Its absence will lead to an inability to launch the Selenium test scripts contained in Google Chrome. Additionally, the automation of any web application would be impossible without it. This reinforces the fact that the ChromeDriver is required to execute test cases on the Google Chrome browser.

WebDriver

When considering the WebDriver from the Selenium perspective, it is easy to note how identical the WebDriver interface is to an agreement where vendors of third-party browsers like Internet Explorer and Mozilla Firefox are required to follow strictly. This simultaneously allows end-users to compute a common code through the exposed APIs. It also boosts the functionality and response in all browsers available.

Copyright © 2020 Katalon LLC.

By leveraging the WebDriver driver = new ChromeDriver(), it is possible to produce instances where the WebDriver interface is cast into the ChromeDriver class. Some browser drivers that utilize the WebDriver include Firefoxdriver, ChromeDriver, PhantomJSDriver, and many others.

This simply indicates that if we decide to use WebDriver driver, this makes it possible to use the initially executed driver for the numerous browsers, which are meant to be automated like Opera, Safari, etc.

Posted on Leave a comment

How do I Run Selenium in Xvfb

Many people utilize the Selenium WebDriver for interaction automation with a browser, either Chrome, Selenium, Firefox, etc. However, the need to have another computer that possesses a desktop environment to execute this automation can be quite tasking and stressful. Usually, when different scenarios need to be executed, a browser will be launched by Selenium, and the script will be executed.

Installing the Xvfb

It is possible to utilize the headless Command-line argument in Chrome and Firefox. You are, however, required to configure your webdrivers to suit this command, but you need to know that while the majority of them will support this, some won’t. This has proven to be a good option for support on different platforms. The Xvfb is a display server that majorly functions to implement the X11 display server protocol. You can run any application in headless mode through this program. As opposed to the usual operation of outputting the Graphics User interface on your screen, it instead produces a virtual framebuffer which displays the User interface there. To install the Xvfb, you need to run the following code:

sudo apt-get install xvfb

To use this program easily, you can execute any command that requires a screen through the Xvfb-run Command.

xvfb-run ./Runner

In a case as above, the Runner is a console application that utilizes the Selenium to execute the automation process in browsers like Chrome and Firefox. Through this, you can successfully make the GUI application headless.

It is also possible to utilize the PyVirtualDisplay, which is a python wrapper for Xvfb, to execute any headless WebDriver tests.

#!/usr/bin/env python
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(800, 600))
display.start()
# now Firefox will run in a virtual display.
# you will not see the browser.
browser = webdriver.Firefox()
browser.get('http://www.google.com')
print browser.title
browser.quit()
display.stop()

It is also possible to utilize the Xvfbwrapper, which possess an identical module without any external dependencies.

from xvfbwrapper import Xvfb
vdisplay = Xvfb()
vdisplay.start()
# launch stuff inside virtual display here
vdisplay.stop()

or in another way, you can use it as a context manager

from xvfbwrapper import Xvfb
with Xvfb() as xvfb:
    # launch stuff inside virtual display here.
    # It starts/stops in this code block
Posted on Leave a comment

How to reconnect to the browser opened by webdriver with selenium

Due to different reasons, a programmer may find it very difficult to reconnect to the browser opened by webdriver with selenium. When this happens, programming work will become stagnant. Therefore, this article will provide a way out.

What to do

Usually, a connection URL and a session_ID is what represents the Selenium – WebDriver session. Therefore, you can reconnect with an existing one. This approach of reconnecting to the browser will utilize the Selenium internal properties, which tend to be different in new versions. As a result of this, it is advisable not to use the method explained here for production code against Remote SE.

Immediately after the webdriver instance is launched, it is crucial to access the properties that were noted earlier. A sample of this is provided below:

from selenium import webdriver

driver = webdriver.Chrome()
driver.get('https://www.google.com/')

now Google is opened, the browser is fully functional; print the two properties
command_executor._url (it's "private", not for a direct usage), and session_id
print(f'driver.command_executor._url: {driver.command_executor._url}')
print(f'driver.session_id: {driver.session_id}')

After establishing both properties, then it is easy to connect another instance, which will help launch a remote driver as well as the URL included above. Doing this will help connect the running Selenium process below:

driver2 = webdriver.Remote(command_executor=the_known_url) 
when the started selenium is a local one, the url is in the form 'http://127.0.0.1:62526'

New Browser Window

After successfully running the code, a new browser window will be launched subsequently due to the automatic launch of a new session by the Selenium library, thus resulting in two sessions in a single webdriver process.

When you try navigating a URL afterwards, it is possible to notice the execution on the new browser instance as opposed to the results obtained from the initial start, which was not desired. When you find yourself at this point, there are a couple of things that need to be done. First of which is exiting the SE session, after which you then switch to the initial (old) SE Session.

This is displayed below:

if driver2.session_id != the_known_session_id:   # this is pretty much guaranteed to be the case
driver2.close() # this closes the session's window - it is currently the only one, thus the session itself will be auto-killed, yet:
driver2.quit() # for remote connections (like ours), this deletes the session, but does not stop the SE server
take the session that's already running
driver2.session_id = the_known_session_id
do something with the now hijacked session:
driver.get('https://www.bing.com/')

Conclusion

Simple and straightforward, just like that, you are successfully reconnected to the initial SE sessions you were on, containing all the properties before disconnection i.e. cookies.

Posted on Leave a comment

How to Fix WordPress White Screen of Death

The WordPress white screen of death is a pervasive error with WordPress sites. Getting this error can be frustrating, and you may not know the specific reason why it occurs. This article will show you different steps to take to fix this error.

Clear Browser Cache

Before you start probing the WordPress site, let’s confirm your browser is not the cause of the issue.

  • If you use Firefox, click the menu button; select Options; click Privacy & Security; under Cookies and Site Data, click Clear Data.
  • If you use Chrome, click the three dots at the top right corner; select More Tools; then, click Clear Browsing Data.

If the error still exists, consider the next step.

Test Your Plugins

First, think about the last action you took on your site before the error happened. It’s possible that you recently activated or updated a plugin. Plugins are common reasons behind the WordPress White Screen Death error. Try to deactivate the plugin and reload your site to see if everything comes back to normal. If not, you can test your plugins with Testup.

Switch to the Default Theme

If plugin troubleshooting does not fix the error, you can consider replacing your current theme with the default theme. To do this, access your admin area and go to Appearance > Themes in your WordPress dashboard. Locate and activate the default theme.

Not Lucky yet?

Other things you can do to fix WordPress White Screen Death error include the following:

  1. Check the memory limit; increase it if possible.
  2. Switch to WordPress debug mode to view your error log.
  3. Check for Failed Auto-Update Issues
  4. Restore to backup

Posted on Leave a comment

10 Reasons You Can not Develop Software without Manual Testing

Manual testing is executed by an individual clicking through the application or interacting with the software and APIs with the relevant tools. In a software development project, errors can surface in any software development stage, some of them even remain hidden. Hence, the importance of testing software developed before using it. 

Here are 10 Reasons you cannot develop Software without Manual Testing:

1. To Avoid Starting the Development again

Manual Software testing points you to errors and flaws. If you wait and neglect your software’s manual testing, you may have to restart the whole development again. Hence, it is advisable to test your software in its development phase.

2. To Know if the Software is User Friendly

The Scalability of any software depends on how user-friendly it is for the customer and how satisfied they are. Thus, it is necessary to test the software and ensure that errors do not occur before it reaches the clients or end-audience.

3. To Build Customer Trust In Software

When patronizing a product, most customers value the quality of the finished product. A low-quality product can cause customers to lose confidence in you, affecting your business as well. It is crucial to have the software tested properly.

4. To Avoid Additional Expenses

People always trust affordable products that have low maintenance costs and provide accurate and consistent results. A software or application full of errors can generate additional costs, and you can lose your customers.

5. To Know f the Software has Faulty Cryptic Features

No customer accepts a product with faulty hidden features. Hence, it is required to perform a manual software test to avoid a situation where the clients will be the ones to determine the hidden flaws.

6. Your Software will End up as a Waste if you Fail

The software test is crucial to ensure that the software does not become a waste. It can cause both financial and Technical losses. As you know, every brand’s dream is to see their product becoming a success in the industry. Nobody wants their tool to be rejected!

7. Fear of the Unknown and Low Performance

A software with low performance can cloud your brand in the market. People will lose their trust in your services, and your company’s reputation will most definitely suffer. If you put your software on the market without a proper manual test, and the performance is not up to the customer’s expectation, it won’t be easy to convince people that the software or product is good.

8. To Verify all Aspects of the Software

Software Testing allows you to see all aspects of the software. For example, you can check the browser’s compatibility and, if you find an error, you have the option to correct them. I can save you from complaints once the software or application has reached customers.

9. To Determine the Quality of the Software before Marketing

As stated above, the quality of the software is crucial in the world of competitive tech. Before pushing the software to the real world, it should be tested by experts. Sometimes, a small mistake leads to significant loss and affects the reputation of the company. 

10. To Accelerate the Development Phase of the Software

Manual Software testing helps developers find errors and scenarios to reproduce the errors, making it very easy for them to fix them quickly. Also, software testers can work with the development team, accelerating the whole process.

Conclusion

The role of manual testing in software development cannot be overemphasized. An excellent testing suite should try to break your app and help understand its limits while providing you that great breakthrough you need for your software.

Posted on Leave a comment

How to Fix the “Missing a Temporary Folder” Error in WordPress

When you get Missing a Temporary Folder error in WordPress, it can prevent you from uploading files and images as well as updating plugins and themes. In this article, you will find how you can solve this issue fast and get your WordPress up and running without much hassle. All you have to do is to follow the steps below.

Step 1: Login to Your CPanel

Step 2: Open the File Manager

In the file manager, navigate to the public.html folder where you will find the wp-config.php file.

Step 3: Right-Click the wp-config.php file to Select Edit

Add the code below in the file and click Save Changes

 define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/'); 

By doing this, you have defined the temporary folder. It’s now time to create it.

Step 4: Create a Temp Folder inside wp-content

To do this, open the wp-content directory inside the file manager.

Navigate to the +Folder link in the cPanel menu.

You will get a popup asking you to provide the name for the new folder. Name it temp and then click on Create New Folder. Refresh the page to see the new folder.

That’s all! You can now carry out the action you wanted to perform when you got the Missing a Temporary Folder error.

Posted on Leave a comment

Fixing Common SSL Issues in WordPress

Several errors can occur when trying to add SSL with your WordPress website. In this article, you will learn how you can fix these errors.

NET:ERR_CERT_INVALID Error

If you get this error, it means the SSL certificate may be expired or issued to a different domain or subdomain. Also, the browser may be facing issues trying to recognize its authority. To fix this error, you can reinstall the SSL certificate.

Mixed Content Errors

Mixed Content Errors are caused by the elements, like scripts or images, not being loaded via secured HTTP protocol. You can fix this in two ways; first is by using a plugin. The second way is by fixing the issue manually.

Fix Using a Plugin

Get the Really Simple SSL plugin from the WordPress repository. After installation and activation, go to Settings > SSL to review plugin settings. The plugin will automatically fix the errors.

Fix it Manually

First, make sure you are using the HTTPS protocol in your WordPress website settings. Go to the general settings of your website to change HTTP to HTTPS.

Once this is done, go through your website manually to check old HTTP URLs in your database and replace with the new HTTPS URLs. An easy and fast way of doing this is by installing the Better Search Replace plugin. Activate the plugin, go to Settings > Tools > Better Search Replace. Then, add the current HTTP website URL in the Search field. Afterwards, add the website URL with HTTPS in the Replace field.

Fixing the Too Many Redirects Errors

To fix this error, access the wp-config.php file and put the following code.

define(‘FORCE_SSL_ADMIN’, true);

However, in some cases, this setting can actually lead to many more redirect errors. In such case, add the following code to your wp-config.php file:

define(‘FORCE_SSL_ADMIN’, true);
//in some setups HTTP_X_FORWARDED_PROTO might contain
//a comma-separated list e.g. http,https
//so check for https existence
if (strpos($_SERVER[‘HTTP_X_FORWARDED_PROTO’], ‘https’) !== false)
$_SERVER[‘HTTPS’]=’on’;

Fix HTTP to HTTPS Redirect

You can fix this error can accessing your .htaccess file and adding the code to it.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

Conclusion

Try the solutions discussed above and you see your WordPress website up and running, again.

Posted on Leave a comment

Fixing WordPress Not Sending Email Issue

Have you faced an issue with WordPress not sending emails properly or at all? You are in the right place at the right time, as this article will show you how you get email up and running on your WordPress website.

Test Email on your Server

First, run a test on your WordPress site with a free Email Check plugin provided by WordPress itself. By running this test, you will know if your WordPress installation and the server can send emails. After installing the plugin, go the Tools menu under your WordPress dashboard and click Check Email. Enter an email address and click Send test email.

Check your email to see if you get the test the email. The subject of the email will be “Test email from https://yourdomain.com.” You should also check your junk or spam mail folder. If you find the email, then the issue of emails not sent in the past is probably due to misconfiguration or an incompatibility. You can check your WordPress mail settings or contact your plugin developer for help.

Use SMTP to Send your Emails

Here is another way to resolve the email issue in WordPress. There are several SMTP providers that you can choose from; they include Gmail, Mailgun, SendGrid, WPforms, etc. All you need to do is to download the SMTP plugin of any of these providers from the WordPress repository.

To install the plugin, go to Add New Plugin, click the upload tab, browse for the plugin file, click Install Now and hit the activate button.

Using Gmail SMTP

For Gmail SMTP, you need to authorize your WordPress installation to use Google’s servers. To do this, you have to create a set of secure credentials. Visit console.developers.google.com, log in to your Gmail account, Click My Project, and click the Add (+)to create a new project. In the dashboard of the new project, click Enable APIs and Services.

Click on Gmail API under G Suite APIs. On the next screen, click Enable.

Next, click on Credentials on the left-hand side and under Create credentials, choose OAuth client ID. Then, click Configure consent screen.

Afterwards, input your email address, a product name, and a privacy policy URL. On the next screen, choose web application. Enter a name, paste the Authorized JavaScript origins URL, and the Authorized redirect URIs from the Gmail SMTP wizard on WordPress. Then click Save.

Once you do this, you will get your client ID and client secret. Copy and paste them into the fields on the Gmail SMTP wizard in on WordPress. Click Next and then, Finish. That’s all.

Posted on Leave a comment

How to Fix the WordPress Login Redirect Loop

On some occasions, you or your users may experience WordPress login redirect loop in which you are redirected back to the login screen after logging in. This prevents you from accessing the admin panel of your website. Therefore, you are unable to manage your site or create new content. Testup is here with three methods you can use to fix this issue.

Clear Browser Cache and Cookies

If your browser’s cache and cookies hold onto to outdated information and use old WordPress files, it can lead to WordPress login redirect loop. To clear your browser caches and cookies, take the following steps:

  • On Google Chrome, click the three dots at the top-right corner. Select More tools and click Clear browsing data.
  • On Mozilla Firefox, click the three horizontal lines at the top-right corner. Go to Preferences, click Privacy and Security. Navigate to Cookies and Site Data and select Clear Data. Mark the options Cookies and Site Data as well as Cached Web Content; then, click Clear.
  • On Safari, go to Preferences, click on Privacy. Then, select Remove All Website Data and click Remove Now.
  • On Microsoft Edge, click the three dots at the top right corner and select History. Select Clear History; tick the options Cached data and files as well as Cookies and saved website data. After that, click Clear.

Restore Default .htaccess file

If you still see the login redirect loop after clearing browser cache and cookies, then you can restore the default .htaccess file. To do this, access the WordPress root folder through an FTP or a File Manager. Locate the .htaccess file and delete it.

Deactivate Themes and Plugins

WordPress login redirect loop can also be caused by conflicting or corrupt plugins or themes. To deactivate your WordPress plugins, access the websites’ wp-content directory through an FTP or a file manager. Then, rename the plugin folder to deactivate all plugins. To deactivate a theme, find the themes’ folder in your wp-content directory and rename the folder.

Posted on Leave a comment

How to Fix WordPress 500 Internal Server Error

What can be more frustrating than a website working perfectly seconds ago displaying 500 Internal Server Error? If you are at this crossroad, this article will explain the steps you can take to fix the error. But before you start, it’s good to make a complete backup of your site. If you are ready, here we go!

Deactivate all Plugins and Themes

Go to your dashboard and deactivate all your plugins. Check the website again; if it loads without internal server error, it means the issue was with one of the plugins.  Switch them one by one to know the exact plugin that caused the error. Also, you can switch to the default theme. If your site loads without an error, then the issue was with the theme.

Turn on Debugging

Another way to get rid of the error is to turn on debugging. You can do this by editing your site’s wp-config.php file. Access the file and search for WP_DEBUG. If you find it, then, set it to “true” as shown below. If you don’t find it, write it yourself. Either way, you should have the line shown below.

define( "WP_DEBUG", true );

Check your .htaccess File

Use your FTP to access .htaccess file in your WordPress root folder. Create a back up of the file and then delete the original file. Check if your website is back without error. If it is, then, the .htaccess file has issues. Go through it line by line to get the offending line. You may have to delete the line.

Other Options

If all the solutions discussed above did not bring the website back live. You can try other options like increasing your WordPress memory limit, clearing your browser cache, checking your server logs, or reinstalling your WordPress core.