Skip to content

Commit e571e4b

Browse files
committed
fix: remove element ID marking from deepcrawl
1 parent bd2168a commit e571e4b

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

webqa_agent/actions/scroll_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ async def scroll_and_crawl(
346346
screenshot_image_list = container_screenshots
347347
break
348348
else:
349-
logging.warning("No scrollable containers found, taking single screenshot")
349+
logging.debug("No scrollable containers found, taking single screenshot")
350350
timestamp = time.strftime("%Y%m%d%H%M%S")
351351
processed_filename = f"{timestamp}_{page_identifier}_no_scroll"
352352
screenshot_base64 = await self._action_handler.b64_page_screenshot(file_name=processed_filename)

webqa_agent/crawler/deep_crawler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def get_clickable_elements(self) -> List[Dict[str, Any]]:
180180
h = vp.get("height")
181181
if w is not None and h is not None:
182182
coords.append({
183-
"id": n.id,
183+
# "id": n.id,
184184
"tag": n.tag,
185185
"center_x": n.center_x,
186186
"center_y": n.center_y,

webqa_agent/crawler/dom_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def build_root(cls, data: Dict[str, Any]) -> 'DomTreeNode':
131131
if data.get('node') is None:
132132
fake_node = {
133133
'node': {
134-
'id': None,
134+
# 'id': None,
135135
'highlightIndex': None,
136136
'tagName': '__root__',
137137
'className': None,
@@ -171,7 +171,7 @@ def build_dom_tree(data: Dict[str, Any],
171171
attrs = {a['name']: a['value'] for a in node_data.get('attributes', [])}
172172

173173
node = cls(
174-
id=node_data.get('id'),
174+
# id=node_data.get('id'),
175175
highlightIndex=node_data.get('highlightIndex'),
176176
tag=(node_data.get('tagName') or '').lower() or None,
177177
class_name=node_data.get('className'),

webqa_agent/crawler/js/element_detector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@
713713
});
714714

715715
return {
716-
id: getElementId(elem),
716+
// id: getElementId(elem),
717717
node: elem,
718718
tagName: elem.tagName.toLowerCase(),
719719
className: elem.getAttribute('class') || null,

webqa_agent/testers/case_gen/tools/element_action_tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async def _check_for_ui_error(
8989

9090
logging.debug(f"Error detection result: {'ERROR' if error_detected else 'NO ERROR'}")
9191
if error_detected:
92-
logging.warning(f"UI error detected: {error_message}")
92+
logging.debug(f"UI error detected: {error_message}")
9393
else:
9494
logging.debug("No UI validation errors detected")
9595

@@ -212,7 +212,7 @@ async def _arun(
212212
error_msg = error_check_result.get("error_message", "Validation error detected")
213213
reasoning = error_check_result.get("reasoning", "")
214214

215-
logging.warning(f"UI validation error detected: {error_msg}")
215+
logging.debug(f"UI validation error detected: {error_msg}")
216216
logging.debug(f"Error reasoning: {reasoning}")
217217

218218
# Format as expected by execution agent

webqa_agent/testers/function_tester.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ async def action(self, test_step: str, file_path: str = None) -> Tuple[Dict[str,
9494
dp = DeepCrawler(self.page)
9595
_, id_map = await dp.crawl(highlight=True, viewport_only=True)
9696
await self._actions.update_element_buffer(id_map)
97+
logging.debug(f"action id_map: {id_map}")
9798

9899
# Take screenshot
99100
marker_screenshot = await self._actions.b64_page_screenshot(file_name="marker")

0 commit comments

Comments
 (0)