我想从此查询中获取ExtractedDate的值,并在下一个查询中将其用作@LastExtractDate.我怎么做?
SELECT TOP 1 [ExtractedDate]
FROM [OnsiteV4].[dbo].[SqlPendingIndex] order by ExtractedDate desc
Run Code Online (Sandbox Code Playgroud)
下一个查询:
insert into @table(Hex, KeyDeviceId, ObjectDateTime, ExtractedDate )
SELECT CONVERT(VARCHAR(MAX), CONVERT(VARBINARY(MAX), ObjectValue, 1)) AS Hex, KeyDeviceId, ObjectDateTime , GETDATE ()
FROM SQLPending
WHERE (ObjectSubType LIKE '%GAS%') and (ObjectDateTime > @LastExtractDate)
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用这个元素:
cy.get('[data-cy-component=single-picker-search] input').type('Live');
Run Code Online (Sandbox Code Playgroud)
当我运行它时,它告诉我有超过 1 个,所以它不能这样做。
我尝试添加 { force: true } - 没有任何区别。
我尝试查看每个元素,但如果元素不可见,则失败:
cy.get(singlePickerSearch).each(($el) => {
cy.wrap($el).type('Live' + '{enter}');
});
Run Code Online (Sandbox Code Playgroud)
如何让它只输入元素可见的位置?我不希望它在这方面失败。
在尝试使用Visual Studio 2017重新编译解决方案中的所有文件时,我收到以下无法提供的错误消息:
Web Compiler在compilerconfig.json中发现错误
首先,解决方案中有多个compilerconfig.json文件.
其次,没有任何迹象表明错误是什么,它出现在哪里(例如,行号).
我有什么想法可以解决这个问题吗?
我有一台运行 Windows 10 Pro for Workstations 的电脑,当前使用 Films & TV 打开 Typescript 文件(扩展名 .ts)。我已进入“设置”>“按文件类型选择默认应用程序”,并将其更改为 Visual Studio Code,但它没有更改。到目前为止,我已经卸载了“电影和电视”并关闭了 Windows Media Player,但它仍然不会保存我的默认选择。我也尝试过:导航到 .ts 文件。右键单击并选择打开方式。勾选该框 - 始终使用此应用程序打开 .ts 文件。选择 Visual Studio Code 并确定。它仍然没有改变。
我正在从源代码管理和Visual Studio中检索旧程序,该程序告诉我源文件需要转换。如何确定不进行转换就可以打开源代码所需的Visual Studio版本?
我在以下代码中遇到异常:
(System.IO.MemoryStream) Stream stream = new MemoryStream(fcr.FileContents);
System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
Run Code Online (Sandbox Code Playgroud)
我将它包装在 Try/Catch 中,并且在第二行抛出异常:Message = "Parameter is not valid."
我检查了变量的内容stream。这就是错误所在。展开 的内容stream,我发现:
Read.TimeOut: 'stream.Read.TimeOut'threw an exception of type
'System.InvalidOperationException'
Write.TimeOut: 'stream.Write.TimeOut' thew an exception of type
'System.InvalidOperationException'
Run Code Online (Sandbox Code Playgroud)
我有两个问题:
我该如何解决?
using (Stream stream = new MemoryStream(fcr.FileContents))
{
System.Drawing.Image img = System.Drawing.Image.FromStream(stream, true, true);
Run Code Online (Sandbox Code Playgroud)在这里继续崩溃,参数无效。对象流仍然具有读取和写入超时消息。
应该有更好的方法来做到这一点,但我找不到。页面上有许多具有相同选择器的元素。仅值属性不同。控件是动态创建的,因此我无法更精确地确定它们。
我正在使用 Cypress 搜索具有特定值的元素。HTML 看起来像这样:
<input type="button" value="Save" data-cy-component="button-button" class="btn form-control btn-info">
Run Code Online (Sandbox Code Playgroud)
当我找到它时,我想单击它并跳出循环。
这就是我所拥有的:
const buttonButton = '[data-cy-component=button-button]';
cy.get(buttonButton).each(($el, index, $list) => {
cy.log(`index: ` + index);
if (index === 5) {
cy.wrap($el)
.should('have.value', 'Save')
// Click Save button.
.click();
}
});
Run Code Online (Sandbox Code Playgroud)
这种方法有效,但似乎很脆弱。如果我的“保存”按钮不再是第五(或第六)元素,则测试将失败。有没有办法可以用 IF 而不是 SHOULD 来测试它?
我正在使用Cypress cy.get来获取元素,但是如果没有元素,则测试失败。我不希望它失败。我希望它继续。测试只是列出其中的项目(如果有)。
const listItemTitle = '[data-cy-component=list-item-title]';
cy.get(listItemTitle).each(($el, index, $list) => {
cy.wrap($el).then(($span) => {
const spanText = $span.text();
cy.log(`index: ` + index + ' ' + spanText);
});
});
Run Code Online (Sandbox Code Playgroud)
我本来以为,如果那里没有任何元素,那么这段代码仍然可以,但事实并非如此。当我运行它时,出现以下错误:CypressError:重试超时:预期找到元素:“ [data-cy-component = list-item-title]”,但从未找到。
在存在元素的地方效果很好。如果未找到任何元素,我要继续进行其他测试。
这是我尝试的实验:
let count: number = Cypress.$(listItemTitle).length;
cy.log('before:' + count);
cy.get(actionsBarActionsAdd).click();
cy.get(singlePickerSearch).type('Assets' + '{enter}');
cy.get(listItemCheckboxTitle)
.first()
.click();
cy.toast({
type: 'Success',
});
count = Cypress.$(listItemTitle).length;
cy.log('after:' + count);
cy.get(listItemTitle).each(($li, index, $lis) => {
cy.log('interface no. ' + (index + 1) + ' of ' + $lis.length);
cy.wrap($li).click();
}); …Run Code Online (Sandbox Code Playgroud) 我试图找到任何真正有效的 Selenium 教程。目前在看这个 项目没有编译。它有6个错误:
1) Firefox Driver cannot be resolved to a type
2) The import org.openqa cannot be resolved.
3) The import org.openqa cannot be resolved.
4) The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project.
5) The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files.
6) WebDriver cannot be resolved to a type.
Run Code Online (Sandbox Code Playgroud)
我的类路径中有以下内容: …
我目前正在尝试学习 Cypress 进行自动化测试。
我想找到并点击这个元素:
<input type="email" class="form-control text-ellipsis-global GKMU5SYDM3B" id="gwt-uid-1419" data-empty="true">
Run Code Online (Sandbox Code Playgroud)
我不能使用 id 或“GKMU5SYDM3B”,因为它们都是由 GWT 随机生成的。
我希望我的命令类似于这样:
cy.get('input').type('email').click().type('fake@email.com')
.should('have.value', 'fake@email.com')
Run Code Online (Sandbox Code Playgroud)
我尝试了这个并收到以下错误消息:
CypressError: cy.type() can only be called on a single element. Your subject contained 4 elements.
Run Code Online (Sandbox Code Playgroud) cypress ×4
asp.net-mvc ×1
c# ×1
eclipse ×1
java ×1
json ×1
selenium ×1
sql ×1
sql-server ×1
typescript ×1
windows-10 ×1