simple_webdriver_client.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Super dumb and simple WebDriver client. Works with selenium standalone, may or may not work yet
  3. * directly with other drivers.
  4. */
  5. export declare class SimpleWebDriverClient {
  6. seleniumAddress: string;
  7. constructor(seleniumAddress: string);
  8. /**
  9. * Send an execute script command.
  10. *
  11. * @param sessionId
  12. * @param data A JSON blob with the script and arguments to execute.
  13. */
  14. execute(sessionId: string, data: string): Promise<void>;
  15. /**
  16. * Send an execute async script command.
  17. *
  18. * @param sessionId
  19. * @param data A JSON blob with the script and arguments to execute.
  20. */
  21. executeAsync(sessionId: string, data: string): Promise<void>;
  22. /**
  23. * Get the location of an element.
  24. *
  25. * @param sessionId
  26. * @param elementId
  27. * @returns Promise<{}> A promise that resolves with the x and y coordinates of the element.
  28. */
  29. getLocation(sessionId: string, elementId: string): Promise<void>;
  30. /**
  31. * Get the size of an element.
  32. *
  33. * @param sessionId
  34. * @param elementId
  35. * @returns Promise<{}> A promise that resolves with the height and width of the element.
  36. */
  37. getSize(sessionId: string, elementId: string): Promise<void>;
  38. private createSeleniumRequest(method, messageUrl, data?);
  39. }