HTML代码
<a href="" ng-click="select()" tab-heading-transclude="" class="ng-binding">RESUME</a>Run Code Online (Sandbox Code Playgroud)
问题: 在我们的应用程序中单击链接后,页面将在新选项卡中打开.在那个新页面中,我必须单击"继续"选项卡(它位于页面中间).
我必须向下滚动并单击该选项卡,但无法单击.
我的代码:
browser.executeScript('window.scrollTo(0,250);');
element(by.partialLinkText("RESUME")).click();
Run Code Online (Sandbox Code Playgroud)
请帮我
这是HTML代码:
<input type="file" class="fileUploadInput" name="fileUpload" id="fileUploadInput" accept="application/msword,application/pdf,text/plain,application/rtf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.oasis.opendocument.formula" multiple="multiple" title="Choose File">
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
browser.wait(function(){
return element(by.id('.filepicker_dialog_container')).isPresent();
}).then(function() {
browser.driver.switchTo().frame('.filepicker_dialog');
}).then(function(){
var fileToUpload = '/home/raghavendra/Desktop/f0657c76d96b9ddab5562b8391297dbbb01488fec4e79a4c13195aea.doc';
var absolutePath = protractor.basePath.resolve(__dirname, fileToUpload);
$("#fileUploadInput").sendKeys(absolutePath);
});
Run Code Online (Sandbox Code Playgroud)
我这样做,现在没有收到任何错误,但它没有上传文件.弹出窗口现在没有关闭.
这是我的完整代码:
var path = require('path');
var ptor = browser,
driver = browser.driver;
describe('Hirealchemy roles', function() {
it('while clicking filepicker icon', function () {
$('.icon-people').click();
browser.sleep(5000);
browser.driver.findElement(By.xpath('/html/body/div[4]/div/ng-view/div/div/div[2]/' +
'section/div/div/div[1]/form/div[2]/input')).sendKeys(group_name);
browser.sleep(5000);
element.all(by.css('.btn.btn-main')).click();
browser.sleep(5000);
browser.wait(function(){
return element(by.id('filepicker_dialog')).isPresent();
})
.then(function(){
ptor.switchTo().frame('filepicker_dialog');
})
.then(function(){
var fileToUpload = '/home/raghavendra/Desktop/50_resumes/f0657c76d96b9ddab5562b8391297dbbb01488fec4e79a4c13195aea.doc';
var absolutePath = path.resolve(__dirname, fileToUpload);
driver.findElement(By.id('fileUploadInput')).sendKeys(absolutePath);
}) …Run Code Online (Sandbox Code Playgroud) Conf.js
如何从gmail中读取OTP.我试过但我不能也没有得到任何错误.
这是脚本
def validate_record_schema(record):
device = record.get('Payload', {})
manual_added= device.get('ManualAdded', None)
location = device.get('Location', None)
if isinstance(manual_added, dict) and isinstance(location, dict):
if 'Value' in manual_added and 'Value' in location:
return False
return isinstance(manual_added, bool) and isinstance(location, str)
print([validate_record_schema(r) for r in data])
Run Code Online (Sandbox Code Playgroud)
这是json数据
data = [{
"Id": "12",
"Type": "DevicePropertyChangedEvent",
"Payload": [{
"DeviceType": "producttype",
"DeviceId": 2,
"IsFast": false,
"Payload": {
"DeviceInstanceId": 2,
"IsResetNeeded": false,
"ProductType": "product",
"Product": {
"Family": "home"
},
"Device": {
"DeviceFirmwareUpdate": {
"DeviceUpdateStatus": null,
"DeviceUpdateInProgress": null,
"DeviceUpdateProgress": null, …Run Code Online (Sandbox Code Playgroud) 第一功能
describe('Shortlisting page', function () {
it('Click on candidate status Screened', function () {
element(by.css('i.flaticon-leftarrow48')).click();
browser.sleep(5000);
browser.executeScript('window.scrollTo(0,250);');
element(by.partialButtonText('Initial Status')).click();
browser.sleep(2000);
var screen = element.all(by.css('[ng-click="setStatus(choice, member)"]')).get(1);
screen.click();
element(by.css('button.btn.btn-main.btn-sm')).click();
browser.executeScript('window.scrollTo(250,0);');
browser.sleep(5000);
});
})
Run Code Online (Sandbox Code Playgroud)
第二功能
it('Click on candidate status Screened', function () {
//Here i need to call first function
});
Run Code Online (Sandbox Code Playgroud)
我想在“第二功能”中调用“第一功能”,该怎么做请帮帮我
javascript ×4
protractor ×4
jasmine ×2
angularjs ×1
email ×1
json ×1
python-3.x ×1
selenium ×1
testing ×1