I'm newbie learn smashtest. I want take screenshot, but show error ``
Error: The function
Take screenshot` cannot be found.
Trace:
Open Chrome helloworld.smash:2 --> browser.smash:19
Use browser browser.smash:22 --> browser.smash:58
Navigate to 'http://10.124.57.80:8080/' helloworld.smash:4 --> browser.smash:121
Take screenshot helloworld.smash:7
```
Set user to type Admin
Set user to type Read-Only
Verify user can login
Verify user can open an article
// a bunch of other checks
In the case above, can I limit parallelism so that Set user to type Admin
and Set user to type Read-Only
are never run in parallel?
I know I can do:
Start tests !
Set user to type Admin
Set user to type Read-Only
Verify user can login
Verify user can open an article
// a bunch of other checks
But that would remove all parallelism. I would like to still take advantage of some parallelism by first setting the user to Admin and running all the Verify steps in parallel AND THEN setting the user to Read-Only and running all the Verify steps in parallel again.
@Regenbogenkii I think you would want to define a prop that has an element finder that describes the element with the active class you can then verify this prop after you have made the element active
* On todomvc page {
props({
'updateButton': `.update`,
'updateButtonActive': `.update.active`
});
}
* When Update button is clicked
Click 'updateButton'
* Then Update button is active
Verify 'updateButtonActive'
You can then use the above functions something like:
Given I am at todomvc
When Update button is clicked
Then Update button is active
Open Chrome
Set custom capabilities {
g('browser capabilities', {
"browserName": "chrome",
"platformName": "linux",
"screenResolution": "1920x1080",
"resolution": "1920x1080",
"se:options": {
"timeZone": "US/Pacific",
"screenResolution": "1920x1080"
}
});
}
Should I be able to use Smashtest against an internally-hosted Moon server? The instructions my company gives for standard javascript connection are as follows:
var webdriverio = require('webdriverio');
var options = {
host: 'https://moon.myCompany.com/wd/hub',
desiredCapabilities: {
browserName: 'chrome',
version: '86.0',
enableVNC: false,
enableVideo: false
}
};
var client = webdriverio.remote(options);
And I was launching Smashtest with cls; smashtest --test-server=https://moon.myCompany.com/wd/hub
against this test:
Set custom capabilities {
g('browser capabilities', {
'browserName': 'Firefox',
'version': '87',
'enableVNC': false,
'enableVideo': false
});
}
Open Firefox
Navigate to 'google.com'
Type 'hello world[enter]' into 'textbox'
Type 'hello universe[enter]' into 'textbox'
But I receive UNABLE_TO_VERIFY_LEAF_SIGNATURE unable to verify the first certificate
for each Navigate step.
I have an application with a login page which calls a rest service. How do I mock the api call? I tried the code below in my smashtest but I get a network error in my application.
Mock auth {
await mockHttp('POST', 'http://localhost/auth/authenticate/', '{ "authToken": "ey437854"}');
}
Hi,
Is there a way to get all elements div elements that has a classname of 'classnameX' and click on it and then take a screenshot without having to write a code block/javascript?
Basically I want to do the following:
Get all the div elements with a class of 'tabs' on a web page and click on it.
Then wait 30s for the page to load because it has lots of visuals on it.
Then scroll to every div element within a div.grid-layout element to view the visuals generated on that tab to take a screenshot.
Is there a way for me to do all that without having to write a boat load of javascript?
So, I've discovered there is no way to loop through a list of elements with a list of actions.
So, what I had to do was to use the ordinal prop and manually look at how many elements I needed to act upon.
So the code looks like this:
Open Chrome
On homepage {
props ({
'report tab': '.tab'
})
}
Click '1st report tab'
Click '2nd report tab'
Click '3rd report tab'
Click '4th report tab'
This only shows if there was one operation. But what if I had a set of operations?
Open Chrome
On homepage {
props ({
'report tab': '.tab'
})
}
Click '1st report tab'
Click_through_4_sub_tabs
Click '2nd report tab'
Click_through_12_sub_tabs
Click '3rd report tab'
Click_through_1_sub_tabs
Click '4th report tab'
Click_through_13_sub_tabs
For this I had to create an illusion of having a dynamic set of operations. Here I had to manually create 13 functions to click through tabs 1 to 13. Then I had to manually discover how many sub tabs for each report tab there were and use that function that matched the number of available sub tabs.
Hope this helps anyone that wants to do something similar.
Need help with how to click a button on a page if it's not disabled.
Currently I have the following and in "Initialise page" I have the following
* Initialise page {
let elem = await ${'button[text='click me']:enabled}
if (elem != null) {
elem.click();
}
}
The elem.click() does nothing.
elem is this:
WebElement {
driver_: mixin {
session_: Promise { [Session] },
executor_: Executor { w3c: true, customCommands_: [Map], log_: [Logger] },
fileDetector_: null,
onQuit_: undefined
},
id_: Promise { '40238d6e-dd40-441d-840c-f214263a9942' }
}
@vptes1 Is the documentation (smashtest.io) available for contribution? I'm sure there are some of us that would like to create pull requests to help bolster the documentation.
+1 to this . It would be good to contribute to the documentation with more examples. @vptes1 Maybe you could transfer the pages to a Github repo? Github allows custom domains so smashtest.io
can point at your repo and we just do PRs against it.
@ijazdar:matrix.org
Is there a report.html generated? or do you have this test sample in a github repo?
A good way to find out if it's working for me is.
From what I can see of your images should it not be
click '#Testing option[value="MT"]'
@slowmonkey:
Appreciated for your help.
Please see the below code and UI for the shared query. I'm trying to select the language "Deutsch" from the "Change language" drop but receiving an error "Error: Element not found in time (2 s)". I've also checked there's no any timeout error before my last line against which element isn't found. Could you please check and shared your thoughts to fix this issue.
Open Chrome
Navigate to 'https://developer.mozilla.org/en-US/docs/Tools/'
[
// Wait 5 secs to load the page
Wait '10' secs
Click ['Change language']
Click '#language-selector option[value="de"]'
]
:point_up: Edit: slowmonkey (slowmonkey):
Appreciated for your help.
Thanks
Open Chrome
Navigate to 'https://developer.mozilla.org/en-US/docs/Tools/'
[
// Wait 5 secs to load the page
Wait '5' secs
Click ['Change language']
Click '#language-selector option[value="de"]'
]