Skip to content
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

Selenium Server & Code to use for this library. #46

Open
Chi-EEE opened this issue May 8, 2024 · 0 comments
Open

Selenium Server & Code to use for this library. #46

Chi-EEE opened this issue May 8, 2024 · 0 comments

Comments

@Chi-EEE
Copy link

Chi-EEE commented May 8, 2024

I have managed to get this library to work on selenium-server-4.8.3 but some methods do not work (Submit).

The reason why I'm using this version is because the legacy protocols were removed.

This is using C++ 17:

#include <iostream>

#include <chrono>
#include <thread>

#include <webdriverxx.h>

using namespace webdriverxx;

int main()
{
	try {
		Capabilities common;
		common.SetPlatform(platform::Windows);
		Chrome chrome(common);

		ChromeOptions chromeOptions;

		// Disable W3C spec compliant protocol
		chromeOptions.SetSpecCompliantProtocol(false);

		chrome.SetChromeOptions(chromeOptions);

		WebDriver browser = Start(chrome);
		browser.Navigate("https://google.com");

		Element accept_button = browser.FindElement(ById("L2AGLb"));
		accept_button.Click();

		Element search_elem = browser.FindElement(ByCss("textarea.gLFyf"));
		search_elem.Click();
		search_elem.SendKeys("sha512 helloworld");

		// Submit
		search_elem.SendKeys("\x00A");

		getchar();
	}
	catch (std::exception e) {
		std::cout << e.what() << std::endl;
	}

	return 0;
}
@Chi-EEE Chi-EEE changed the title Guide to use this library: Selenium Server & Code to use for this library. May 8, 2024
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

No branches or pull requests

1 participant