You do not have any UI elements registered yet, so you can follow the following steps to run the tutorial and get your first elements. Or if you know already how to use the tool, simply run a test case and it will show up here
If you haven't done so already, please install selenium and devtools
1 | pip install selenium |
As an example of smartDriver in action, we will use a basic selenium test case that goes to Google and searches for hello world. You can see the SmartDriver lines added to the script. Running this test will automatically leverage the devtools_ai package, it will collect screenshots and bounding boxes for the UI elements involved in the test. Once this is done, the selector could break and your test would still work.
After you run the sample test, refresh this page to see the new UI elements that were registered, you can click on them to display the data that was collected.
After that it is up to you to integrate the tool into more tests and start getting the benefits.
1 | from time import sleep |
If you haven't done so already, please install selenium and devtools.
If you are using Gradle
build.gradle | |
|---|---|
1 | implementation 'ai.dev-tools:ai-devtools:+' |
If you are using Maven
pom.xml | |
|---|---|
1 | <dependencies> |
As an example of smartDriver in action, we will use a basic selenium test case that goes to Google and searches for hello world. You can see the SmartDriver lines added to the script. Running this test will automatically leverage the devtools_ai package, it will collect screenshots and bounding boxes for the UI elements involved in the test. Once this is done, the selector could break and your test would still work.
After you run the sample test, refresh this page to see the new UI elements that were registered, you can click on them to display the data that was collected.
After that it is up to you to integrate the tool into more tests and start getting the benefits.
1 | package my.awesome.pkg; |
If you haven't done so already, please install selenium and devtools
1 | pip install Appium-Python-Client |
As an example of smartDriver in action, we will use the Reddit is fun app and click on some buttons. You can see the SmartDriver lines added to the script. Running this test will automatically leverage the devtools_ai package, it will collect screenshots and bounding boxes for the UI elements involved in the test. Once this is done, the selector could break and your test would still work.
After you run the sample test, refresh this page to see the new UI elements that were registered, you can click on them to display the data that was collected.
After that it is up to you to integrate the tool into more tests and start getting the benefits.
1 | import time |
If you haven't done so already, please install selenium and devtools.
If you are using Gradle
build.gradle | |
|---|---|
1 | implementation 'ai.dev-tools:ai-devtools:+' |
If you are using Maven
pom.xml | |
|---|---|
1 | <dependencies> |
As an example of smartDriver in action, we will use the Reddit is fun app and click on some buttons. You can see the SmartDriver lines added to the script. Running this test will automatically leverage the devtools_ai package, it will collect screenshots and bounding boxes for the UI elements involved in the test. Once this is done, the selector could break and your test would still work.
After you run the sample test, refresh this page to see the new UI elements that were registered, you can click on them to display the data that was collected.
After that it is up to you to integrate the tool into more tests and start getting the benefits.
1 | package my_package |
If you haven't done so already, please install devtools
1 | npm install @devtools-ai/cypress-sdk |
You will need to edit a few files in your root project directory to enable the plugin
Here be careful to edit both index.js and e2e.js if you are doing end to end tests.
cypress/support/index.js and cypress/support/e2e.js | |
|---|---|
1 | import '@devtools-ai/cypress-sdk'; |
These other two files should be in your project root (one level above ./cypress)
cypress.config.js | |
|---|---|
1 | const { defineConfig } = require("cypress"); |
smartdriver.config.js | |
|---|---|
1 | module.exports = { |
As an example of smartDriver in action, we will use a test case that goes to Github and enters a username. Running this test will automatically leverage the devtools_ai package, it will collect screenshots and bounding boxes for the UI elements involved in the test. Once this is done, the selector could break and your test would still work.
After you run the sample test, refresh this page to see the new UI elements that were registered, you can click on them to display the data that was collected.
After that it is up to you to integrate the tool into more tests and start getting the benefits.
spec.cy.js | |
|---|---|
1 | describe("Should be able to login", () => { |
If you haven't done so already, please install devtools
1 | npm install @devtools-ai/wdio-sdk |
You will need to edit wdio.conf.js to enable the plugin
wdio.conf.js | |
|---|---|
1 | beforeSuite: async function (suite) { |
You will need to also set an environment variable with your api key in your terminal or in a .env file. If you want interactive mode you can set the second env variable as well.
.env | |
|---|---|
1 | DEVTOOLSAI_API_KEY=3597425fb9741b441cac2810 |
As an example of smartDriver in action, we will use a test case that goes to Github and enters a username. Running this test will automatically leverage the devtools_ai package, it will collect screenshots and bounding boxes for the UI elements involved in the test. Once this is done, the selector could break and your test would still work.
After you run the sample test, refresh this page to see the new UI elements that were registered, you can click on them to display the data that was collected.
After that it is up to you to integrate the tool into more tests and start getting the benefits.
test/specs/example.e2e.js | |
|---|---|
1 | describe('GH tests', () => { |
If you haven't done so already, please install devtools
1 | npm install @devtools-ai/playwright-sdk |
You will need to set an environment variable with your api key in your terminal or in a .env file. If you want interactive mode you can set the second env variable as well.
.env | |
|---|---|
1 | DEVTOOLSAI_API_KEY=3597425fb9741b441cac2810 |
After that the test case needs to be modified to enable Playwright
As an example of smartDriver in action, we will use a test case that goes to Github and enters a username. Running this test will automatically leverage the devtools_ai package, it will collect screenshots and bounding boxes for the UI elements involved in the test. Once this is done, the selector could break and your test would still work.
After you run the sample test, refresh this page to see the new UI elements that were registered, you can click on them to display the data that was collected.
After that it is up to you to integrate the tool into more tests and start getting the benefits.
tests/example.spec.js | |
|---|---|
1 | const base = require('@playwright/test'); |
---------若是你看了半天没明白 ,我简单说明一下 就是在每次编辑web自动化是 需要进获取name id是 这个工具会自动加载一个小的工具提供给你便捷的使用 不用在打开浏览器 一步一步的找了,提升了效率OK?---------
code/s?__biz=MjM5MjYxNDg0Nw==&mid=2247486996&idx=1&sn=483ee18006ac989d36c43fc6f09a1233&chksm=a6a2dec491d557d292967815f1a29995b6acbbcd17be64bd0a63ad75338fe65df6209647aad5#rd