Not able to establish connection with remote data base usign selenium + C#

31 views
Skip to first unread message

Agustin Gonzalez

unread,
Oct 2, 2023, 11:53:50 AM10/2/23
to Selenium Users
Hi everyone,
I have been creating some test cases that after performing some transactions, a query should be launched to verify the data stored.
I have connected to the vpn prior to execute the tests.

At the beginning I thought it was some issue with the connection string, but it seems to be right.
The error that I got after running the test is
Oracle.ManagedDataAccess.Client.OracleException : Connection request timed out

Has anyone some suggestions to fix this?

Here is the code that I use to connect with the db

    public class DatabaseConnection : IDatabaseConnection
    {
        /// <summary>
        /// Variables
        /// </summary>
        AppSettings _appSettings;
        OracleConnection dbConnection;

        /// <summary>
        /// Class Constructor
        /// </summary>
        public DatabaseConnection(AppSettings appSettings)
        {
            _appSettings = appSettings;
            dbConnection = new OracleConnection();
        }
        public void OpenConnection()
        {

           /*   _appSettings.DataSourceConnection = "Data Source=(DESCRIPTION(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=N.N.N.N)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=QA)));User Id=USER;Password=PASSWORD;" */

            dbConnection.ConnectionString = _appSettings.DataSourceConnection;
            dbConnection.Open();
        }


I'll appreciate any suggestion for this.

Thanks in advance :)




Robble Rouser

unread,
Oct 7, 2023, 5:31:17 AM10/7/23
to Selenium Users
I don't mean to be rude, but this group is Selenium WebDriver scripting and not database connections.
I would suggest searching Google, Stackoverflow, Reddit, etc. regarding remote database connectivity.
Reply all
Reply to author
Forward
0 new messages