使用watir Web驱动程序连接到SQL Server

时间:2021-08-23 02:17:17

I need some help connecting to a SQL database held on a server to compare some values in watir webdriver. Not even sure where to start really. Is there any particular GEM i need to install

我需要一些帮助连接到服务器上保存的SQL数据库,以比较watir webdriver中的一些值。甚至不确定从哪里开始。我需要安装任何特定的GEM吗?

My database lives on server xxx.xxx.xxx.xxx, with a username and password

我的数据库位于服务器xxx.xxx.xxx.xxx上,带有用户名和密码

so I have 2 issues:

所以我有两个问题:

1) how do i connect to the server?

1)我如何连接到服务器?

2) then how do i connect to database?

2)那我如何连接数据库?

1 个解决方案

#1


As Aetherus has said in the comments, watir-webdriver is only an automation tool for web browsers. It runs in ruby, which means that to get the values from the SQL database you can use any ruby gem you like. A good suggestion would be TinyTDS - https://github.com/rails-sqlserver/tiny_tds.

正如Aetherus在评论中所说,watir-webdriver只是Web浏览器的自动化工具。它运行在ruby中,这意味着要从SQL数据库中获取值,您可以使用任何您喜欢的ruby gem。一个很好的建议是TinyTDS - https://github.com/rails-sqlserver/tiny_tds。

#1


As Aetherus has said in the comments, watir-webdriver is only an automation tool for web browsers. It runs in ruby, which means that to get the values from the SQL database you can use any ruby gem you like. A good suggestion would be TinyTDS - https://github.com/rails-sqlserver/tiny_tds.

正如Aetherus在评论中所说,watir-webdriver只是Web浏览器的自动化工具。它运行在ruby中,这意味着要从SQL数据库中获取值,您可以使用任何您喜欢的ruby gem。一个很好的建议是TinyTDS - https://github.com/rails-sqlserver/tiny_tds。