Skip to content

Added Chrome devtools features #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 6, 2020
Merged

Conversation

nainappa
Copy link
Contributor

Description

Added chrome devtools features that are part of Selenium4-alpha versions.

Motivation and Context

The example code snippets would help the users to understand more about the features.

Types of changes

  • Change to the site (I am attaching a screenshot showing the before and after)
  • Code example added (and I also added the example to all translated languages)
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

After:

image

Copy link
Member

@harsha509 harsha509 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nainappa ,

Thanks for the PR. i've couple of things

  1. I think this feature is not ready yet(not fully supported/ have few bugs)
  2. I have tried the code samples and am unable to execute code(running into issues with selenium alpha 5)
  3. I think CDP is not a part of WebDriver specification(am not sure on this). If not, we need to move it out from WebDriver Section

Regards,
Harsha

@nainappa
Copy link
Contributor Author

nainappa commented May 28, 2020

Hi @harsha509

Thanks for reviewing the changes. Below are in-line response.

  1. I just tried the code with Aplha-5. It is working fine. I obviously removed some unwanted code and added only important packages as those packages are new to the users. Please try the below code. This is working for me.
import java.util.HashMap;
import java.util.Map;

import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;

public class SampleTest {
  @Test
  public void geoLocationTest() {
    // driver exe setup
    ChromeDriver driver = new ChromeDriver();
    driver.get("https://the-internet.herokuapp.com/geolocation");
    // click on WhereAmI button. That will show current coordinates
    Map coordinates = new HashMap() {
      {
        put("latitude", 50.2334);
        put("longitude", 0.2334);
        put("accuracy", 1);
      }
    };
    driver.executeCdpCommand("Emulation.setGeolocationOverride", coordinates);
    driver.navigate().refresh();
    // Now again click on WhereAmI button. That will show the changed coordinates
  }
}
  1. Network emulate feature was tested in Alpha-2. Looks like Alpha-5 has some issues. I can remove that feature for now.
  2. executeCDP is part of chromium driver and Devtools is under openq.selenium. Even I was debating about adding it in "Driver idiosyncrasies" or "Webdriver". Since all these features comes under Devtools, I added as part of Webdriver. Please let me know your thoughts.

@nainappa
Copy link
Contributor Author

Hi @harsha509

I removed network emulation feature. Please take a look when you have time.

@nainappa
Copy link
Contributor Author

Hi @harsha509

Do you have any updates on this? If it doesnt make sense, I can close the PR.

@harsha509
Copy link
Member

Hi @harsha509

Do you have any updates on this? If it doesnt make sense, I can close the PR.

Hi @nainappa

The PR is Awesome. Please give us some time as the the team members/core committers also have few suggestions as this is the important feature landing in Selenium4.

Regards,
Harsha.

@harsha509
Copy link
Member

Hi @nainappa ,

I would like to move this document to support package section (temporarily). Please let me know your thoughts on this.

If you are ok with it, can you please make changes. I will merge it.

Regards,
Harsha.

@nainappa
Copy link
Contributor Author

nainappa commented Jun 5, 2020

Hi @harsha509 Sure. I will raise PR with the changes. Thanks for the review.

@diemol diemol changed the base branch from master to dev June 5, 2020 22:01
@nainappa
Copy link
Contributor Author

nainappa commented Jun 6, 2020

Hi @harsha509,

I changed the location to Support Packages now. Please take a look when you have time.

@harsha509
Copy link
Member

Hi @harsha509,

I changed the location to Support Packages now. Please take a look when you have time.

Sure. The build is already in progress :)

I'll merge it when the build is good!

Copy link
Member

@harsha509 harsha509 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @nainappa !

@harsha509 harsha509 merged commit 9f9cf75 into SeleniumHQ:dev Jun 6, 2020
selenium-ci added a commit that referenced this pull request Jun 6, 2020
* Added Chrome Devtools features

* Removed emulate Network Conditions method

* Removed emulate Network Conditions method

* Changed the location to Support Packages

Co-authored-by: Diego Molina <[email protected]>
Co-authored-by: Sri Harsha <[email protected]> 9f9cf75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants