title,body,link,tags,view_count,is_answered,score,answer_count
Selenium webdriver and database testing,"<p>I was looking for the answer on the Internet and I haven't found one so... the thing is: I'm writing automated tests (in java) using selenium and the website that I'm testing has an option of phone number confirmation. 
The user types his phone number, clicks save and to that phone number, we get confirmation code (with an SMS). My question is: how can I test it? Is there any option where I can create a database only for tests or something? </p>
",https://stackoverflow.com/questions/49423333/selenium-webdriver-and-database-testing,"['java', 'database', 'selenium', 'selenium-webdriver', 'webdriver']",90,FALSE,0,1
How to Update different database?,"<p>How to Update data from database ""testing"" to ""testing2"" both have the same column.</p>

<p><a href=""https://i.stack.imgur.com/GX4GJ.png"" rel=""nofollow noreferrer"">Sample Image</a></p>
",https://stackoverflow.com/questions/50985187/how-to-update-different-database,"['mysql', 'sql', 'database', 'localhost']",52,FALSE,-1,2
Unable to use SET in sqlite3 trigger,"<p>I'm attempting to start off a database (testing with sqlite3), but I seem to be unable to do a <code>SET</code> inside a trigger. I get the following error: <code>OperationalError: near ""SET"": syntax error</code>.</p>

<p>An insert from inside the trigger works, so I'm just curious what I'm doing wrong here?</p>

<pre><code>import sqlite3
conn = sqlite3.connect(':memory:')

c = conn.cursor()

c.execute(""""""CREATE TABLE Programs (
    id INTEGER PRIMARY KEY,
    name VARCHAR(64) NOT NULL,
    time_added INTEGER
);"""""")

c.execute(""""""CREATE TRIGGER program_time_added AFTER INSERT ON Programs
    FOR EACH ROW
    BEGIN
        SET new.time_added = UNIX_TIMESTAMP(NOW());
    END;"""""")

c.execute('INSERT INTO Programs (name) VALUES (?)', ['name'])
</code></pre>
",https://stackoverflow.com/questions/52930834/unable-to-use-set-in-sqlite3-trigger,"['python', 'sqlite']",95,FALSE,1,0
64-bit Oracle Client library cannot be loaded in mac,"<p>I have created a sample Python script for Oracle Database connectivity for running queries for Database testing, I have ran the same script on Windows and its running fine but while running on Mac, its showing me this exception again and again.</p>

<pre><code>cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: ""dlopen(libclntsh.dylib, 1): image not found"". See https://oracle.github.io/odpi/doc/installation.html#macos for help
</code></pre>

<p>I have changed my Environmental Variable on bash_profile like these:</p>

<pre><code>export ORACLE_HOME= /opt/oracle/instantclient_12_2/
export DYLD_LIBRARY_PATH=$ORACLE_HOME
export LD_LIBRARY_PATH=$ORACLE_HOME
export PATH=$ORACLE_HOME:$PATH
</code></pre>

<p>Still not working. Can someone help me here. Thanks</p>
",https://stackoverflow.com/questions/53098434/64-bit-oracle-client-library-cannot-be-loaded-in-mac,"['python', 'oracle', 'macos', 'instantclient']",10232,TRUE,1,1
Getting error while connecting to sql server,"<p>Can anyone help me on,
I am trying to connect the sql server and do database testing using selenium webdriver the code is:</p>

<pre><code>try {
    String driver = ""com.microsoft.sqlserver.jdbc.SQLServerDataSource"";
    /*String connection = ""jdbc:mysql://localhost:3306/customer"";*/
    String connection = ""jdbc:sqlserver://Leverage-Laptop\\SQLEXPRESS2008R2:1433;integratedSecurity=True;databaseName=TestDataBase;"";
    //String userName = ""sa"";
    //String password = ""leverage"";
    Class.forName(driver);
    //con = DriverManager.getConnection(connection);

    con = DriverManager.getConnection(connection);
    stmt = con.createStatement();
    return stmt;
} catch (Exception e) {
    e.printStackTrace();
}
</code></pre>

<p>I am getting a exception as below:</p>

<blockquote>
  <p>com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database ""TestDataBase"" requested by the login. The login failed. ClientConnectionId:dc4cee5f-6cb7-4339-8fa8-655d13d525bd</p>
</blockquote>

<p>I have disabled Firewall as well as i have copied the sqljdbc_auth dll in jre lib and bin directory.</p>
",https://stackoverflow.com/questions/49572421/getting-error-while-connecting-to-sql-server,"['java', 'sql-server', 'selenium-webdriver']",197,TRUE,-1,2
Using embedded mongo in spring for local testing only,"<p>I'm trying to use the flapdoodle embedded mongo database ('de.flapdoodle.embed:de.flapdoodle.embed.mongo')
for local manual testing the way I'd use H2 for relational database testing. I only want the embedded mongo to start up when running under the 'local' SPring profile, but I can't figure out how to make it happen -- it just always starts under any profile.</p>

<p>I've tried adding <code>@SpringBootApplication(exclude=EmbeddedMongoAutoConfiguration.class)</code>  to my application (thinking I could reimport that autoconfig to a single profile later) but that doesn't seem to have any affect. </p>

<p>Anyone know how to limit it to a single profile, in a way that will work when running in Eclipse as well as via Gradle?</p>
",https://stackoverflow.com/questions/49156858/using-embedded-mongo-in-spring-for-local-testing-only,"['mongodb', 'spring-boot', 'testing', 'embedded-database']",8029,TRUE,1,1
Ionic SQLite plugin always throws an exception when deleting,"<p>I have an SQLite database, testing on my Android device, with a simple table, where whenever I execute a delete, it always throws an exception, even though the delete succeeds. I can tell it has succeed as the data is gone from the database.</p>
<p>My SQL looks like the following:</p>
<pre><code>    let db = await this.sqlite.create({name: 'mydb.sqlite', location: 'default'});
    let delSql = `DELETE FROM ${this.TABLE_NAME} WHERE GroupName = '${groupName}' AND Id IN  ('CAR01','CAR02');
    await db.executeSql(delSql);
</code></pre>
<p>Catching the exception, it will always throw:</p>
<p><a href=""https://i.stack.imgur.com/3oLCk.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/3oLCk.png"" alt=""enter image description here"" /></a></p>
<p>I have tried to follow the source for the plugin it wraps <a href=""https://github.com/litehelpers/Cordova-sqlite-storage/blob/storage-master/src/android/io/sqlc/SQLiteAndroidDatabase.java"" rel=""nofollow noreferrer"">here</a>, but, as we can see at line 163:</p>
<pre><code>try {
        rowsAffected = myStatement.executeUpdateDelete();
        // Indicate valid results:
        needRawQuery = false;
</code></pre>
<p><code>rowsAffected</code> seems to be set if no exception is thrown, yet in my case (as in the screenshot) this comes back as <code>9</code>, yet I still get an exception.</p>
<p>Why do I always get an exception?</p>
",https://stackoverflow.com/questions/53569070/ionic-sqlite-plugin-always-throws-an-exception-when-deleting,"['ionic-framework', 'cordova-plugins', 'ionic-native', 'cordova-sqlite-storage']",79,FALSE,1,0
Laravel Factory State- Unable to locate factory,"<p>I have a problem when executing the factory, i have used the factory state for factories but it will give me an error when i execute the factory
<a href=""https://laravel.com/docs/5.6/database-testing#factory-states"" rel=""nofollow noreferrer"">https://laravel.com/docs/5.6/database-testing#factory-states</a></p>

<p>I have this UserFactory.php which contains the code below.</p>

<pre><code>&lt;?php

use Faker\Generator as Faker;

$factory-&gt;state(App\User::class,'suggestor', function (Faker $faker) {
    return [
        'FirstName'=&gt;$faker-&gt;firstName, 
        'LastName'=&gt;$faker-&gt;lastName, 
        'Username'=&gt;$faker-&gt;userName, 
        'password'=&gt;bcrypt('123asd!@#'),
        'Email'=&gt;$faker-&gt;email,
        'AccountType'=&gt;0,
    ];
});
</code></pre>

<p>i am using <strong>tinker</strong> to execute the factory commands and tried different syntax but it really does not solve the problem.</p>

<pre><code>&gt;&gt;&gt; factory(User::class, 1)-&gt;states('suggestor')-&gt;make();
[!] Aliasing 'User' to 'App\User' for this Tinker session.
InvalidArgumentException with message 'Unable to locate factory with name [default] [User].'
&gt;&gt;&gt; factory(App\User::class, 1)-&gt;states('suggestor')-&gt;make();
InvalidArgumentException with message 'Unable to locate factory with name [default] [App/User].'
&gt;&gt;&gt; factory(\App\User::class, 1)-&gt;states('suggestor')-&gt;make();
InvalidArgumentException with message 'Unable to locate factory with name [default] [App/User].'
&gt;&gt;&gt; factory('App\User')-&gt;states('suggestor')-&gt;make();
InvalidArgumentException with message 'Unable to locate factory with name [default] [App/User].'
&gt;&gt;&gt; factory('App\User',1)-&gt;states('suggestor')-&gt;make();
InvalidArgumentException with message 'Unable to locate factory with name [default] [App/User].'
&gt;&gt;&gt;
</code></pre>

<p>i hope there's anyone out there can help me.</p>

<p><strong>Update:</strong>
I have tried running it on database seed but i think it's still the same error.
but when i tried on the other model it seems fine. i think the problem is on the User model which comes out of the box by laravel and note that i haven't change anything on the user model except the model attributes.</p>

<p>error produce by seeder
<a href=""https://i.stack.imgur.com/ZKdGR.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/ZKdGR.png"" alt=""enter image description here""></a></p>
",https://stackoverflow.com/questions/51073719/laravel-factory-state-unable-to-locate-factory,"['php', 'laravel', 'state', 'factory']",1753,TRUE,0,2
