Проверьте управление DOM при использовании Селена

Почти вся защита от копирования и неэффективна, и кошмар удобства использования. Часть его, такая как помещение руткитов на машинах Ваших клиентов становится совершенно неэтичной

5
задан Paul Biggar 12 December 2009 в 12:45
поделиться

2 ответа

Для этого не существует встроенного процесса с использованием Selenium. Однако существует проект с открытым исходным кодом, построенный на WebDriver, WebDriver становится Selenium 2, что позволяет вам проводить тестирование макета.

Проект находится по адресу http://code.google.com/p/fighting-layout-bugs/ и впервые был показан на GTAC 2009 в Цюрихе. Код использует W3C и jQuery для проверки действительности DOM. Посмотрите видео выступления и код, который там есть.

РЕДАКТИРОВАТЬ:

Благодаря sampablokuper проверка W3C находится на code.google.com/p/w3c-markup-validation-filter /

4
ответ дан 14 December 2019 в 19:15
поделиться

I've been pondering on the same front. Here's my progress so far.

The JavaScript attribute document.documentElement.outerHTML can be accessed in some browsers, e.g. Safari and Chrome, but not in Firefox. This will show you the result of DOM manipulations but won't give you quite the full source code for the page. If you inject some JavaScript that will store the value of document.documentElement.outerHTML after your DOM manipulation has been carried out, you should be able to get Selenium to type that value into the "direct input" textarea of the W3C Validator and submit it. You'd need to prepend and append the value appropriately in order to make it a valid (X)HTML document. I haven't managed to get all these steps working yet from Selenium.

prepending "view-source:" to the URL (as done here) works in some browsers, e.g. Firefox and Chrome, but not in Safari. It won't show you the result of DOM manipulations. I can't seem to get Selenium IDE to open an address beginning with "view-source:" however; it always prepends a forward slash, and I'm not sure how to avoid that.

I'd be interested to know which other approaches people have tried, and whether they've had any success!

1
ответ дан 14 December 2019 в 19:15
поделиться
Другие вопросы по тегам:

Похожие вопросы: