Skip to content

Commit 7ea2034

Browse files
authored
Merge pull request #309 from webreinvent/feature/update-common-issues-and-solutions
Feature -> Develop | Update Common Issues and Solutions
2 parents 6b26897 + 4470d74 commit 7ea2034

File tree

1 file changed

+125
-4
lines changed

1 file changed

+125
-4
lines changed

content/9.testing/2.automation/1.common-issues-and-solutions.md

Lines changed: 125 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ All the major issues related to the automation testing have been listed down bel
3838

3939
### 2. Error Message: "Details: session not created: This version of ChromeDriver only supports Chrome version"
4040

41-
**Description**: This issue occures when the package: `appium-chromium-driver` is outdated. Due to this there is a mismatch in the chrome browser version and the package.
41+
**Description**: This issue occures when the package: `appium-chromium-driver` and `chromedriver` is outdated. Due to this there is a mismatch in the chrome browser version and the package.
4242

4343
**Solution**:
4444
1. Open the terminal in your project.
@@ -47,11 +47,14 @@ All the major issues related to the automation testing have been listed down bel
4747
npm i appium-chromium-driver --save-dev
4848
```
4949
2. Update the chrome browser to the latest version. Open **Chrome > Settings > About Chrome**
50-
3. Now excute the script by the running the commnd below:
50+
3. Now, open `package.json` file and locate `chromedriver` package.
51+
4. Update the package version with your chrome browser version. Eg. **139.0.0**
52+
5. Run `npm install`.
53+
6. Now excute the script by the running the command below:
5154
```shell
5255
npm run wdio
5356
```
54-
4. The issue should have been resolved.
57+
7. The issue should have been resolved.
5558

5659
### 3. Error Message: "The requested port may already be in use."
5760

@@ -139,4 +142,122 @@ The solution for this issues have to be done in three steps:
139142
9. After setting the path, the environment variables should look something like this:
140143
<img src="/images/testing/java_home_path.png">
141144

142-
After performing the steps mentioned above. The issue should have been fixed.
145+
After performing the steps mentioned above. The issue should have been fixed.
146+
147+
### 7. Error while installing `wdio-chromedriver-service` on webdriverio project.
148+
149+
**Description**: This error occurs due to webdriverio version. Latest webdriverio version doesn't support `wdio-chromedriver-service`.
150+
151+
**Solution**: We need to downgrade the webdriverio version to solve this issue since the latest version: `9.19.1` doesn't support this module.
152+
153+
1. Execute the command given below to downgrade webdriverio version to v8.0.0
154+
```shell
155+
npm install [email protected] --save-dev
156+
```
157+
2. Now, execute the command given below to install `wdio-chromedriver-service` module:
158+
```shell
159+
npm install wdio-chromedriver-service --save-dev
160+
```
161+
162+
**Note:** With the latest webdriverio version: v9. `wdio-chromedriver-service` is no longer required. It automatically fetches the installed chrome version driver.
163+
164+
### 8. Error Message: unknown server-side error: Appium Flutter driver not found
165+
166+
**Description**: Happens when the `appium-flutter-driver` plugin isn’t installed.
167+
168+
**Solution**: Follow the steps mentioned below:
169+
170+
1. Open your system's terminal.
171+
2. Execute the command given below to install appium-flutter-driver plugin:
172+
```shell
173+
appium plugin install --source=npm appium-flutter-driver
174+
```
175+
176+
### 9. Error Message: "A new session could not be created" in Appium tests
177+
178+
**Description**: Occurs when Appium cannot start a session because the desired capabilities are invalid or the device/emulator is not available.
179+
180+
**Solution**: Follow the steps mentioned below:
181+
1. Check if emulator/device is running:
182+
```shell
183+
adb devices
184+
```
185+
Ensure your device is listed.
186+
2. Verify capabilities in `wdio.conf.js` or `wdio.env.js` file:
187+
```js
188+
capabilities: [{
189+
platformName: 'Android',
190+
'appium:deviceName': 'emulator-5554',
191+
'appium:platformVersion': '14',
192+
'appium:automationName': 'UiAutomator2',
193+
'appium:app': '/path/to/app.apk'
194+
}]
195+
```
196+
3. Execute the tests again and check.
197+
198+
### 10. Error Message: "Command not found: wdio"
199+
200+
**Description:** Occurs when you try to run wdio but the CLI is not installed locally or globally.
201+
202+
**Solutions:** Follow the steps mentioned below.
203+
1. Install CLI locally in the project:
204+
```shell
205+
npm install @wdio/cli --save-dev
206+
```
207+
2. Run using npx:
208+
```shell
209+
npx wdio run ./wdio.conf.js
210+
```
211+
### 11. Error Message: "Appium exited before startup"
212+
213+
**Description:** Appium server crashes because of missing dependencies.
214+
215+
**Solutions:** Follow the steps mentioned below.
216+
1. Reinstall Appium 2.x globally:
217+
```shell
218+
npm install -g appium
219+
```
220+
2. Install required drivers (example for Android):
221+
```shell
222+
appium driver install uiautomator2
223+
```
224+
Example for iOS:
225+
```shell
226+
appium driver install xcuitest
227+
```
228+
3. Retry running tests.
229+
230+
### 12. `npm install` command not working
231+
232+
**Error:**
233+
```shell
234+
npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see
235+
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
236+
At line:1 char:1
237+
+ npm install
238+
+ ~~~
239+
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
240+
+ FullyQualifiedErrorId : UnauthorizedAccess
241+
242+
Above error on vs code terminal when i execute npm install.
243+
```
244+
245+
**Description:** On Windows, when you run npm install from the PowerShell terminal in VS Code, PowerShell tries to execute npm.ps1 (the wrapper script for npm). But your system’s execution policy doesn’t allow running PowerShell scripts
246+
247+
**Solutions:** We need to change the PowerShell execution policy to fix this issue. Follow the steps mentioned below:
248+
1. Open PowerShell as Administrator.
249+
2. Execute the command given below:
250+
```shell
251+
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
252+
```
253+
3. Restart VS Code and try again:
254+
```shell
255+
npm install
256+
```
257+
258+
This should fix the problem. However, if this doesn't work, we can change vscode terminal to Command Prompt instead of PowerShell.
259+
1. In VS Code, go to Terminal → New Terminal.
260+
2. Click the dropdown arrow (v) in the terminal tab → select Command Prompt.
261+
3. Run `npm install`.
262+
263+
This also should fix the problem.

0 commit comments

Comments
 (0)