@@ -163,6 +163,30 @@ <h1 class="title">Module <code>pysapscript.window</code></h1>
163
163
except Exception as ex:
164
164
raise exceptions.ActionException(f"Error clicking element {element}: {ex}")
165
165
166
+ def is_selected(self, element: str) -> bool:
167
+ """
168
+ Gets status of select element
169
+
170
+ Args:
171
+ element (str): element select
172
+
173
+ Returns:
174
+ bool: selected state
175
+
176
+ Raises:
177
+ ActionException: error selecting element
178
+
179
+ Example:
180
+ ```
181
+ main_window.is_selected("wnd[2]/tbar[0]/field[1]")
182
+ ```
183
+ """
184
+ try:
185
+ return self.session_handle.findById(element).selected
186
+
187
+ except Exception as ex:
188
+ raise exceptions.ActionException(f"Error getting status of element {element}: {ex}")
189
+
166
190
def set_checkbox(self, element: str, selected: bool) -> None:
167
191
"""
168
192
Selects checkbox element
@@ -482,6 +506,30 @@ <h2 class="section-title" id="header-classes">Classes</h2>
482
506
except Exception as ex:
483
507
raise exceptions.ActionException(f"Error clicking element {element}: {ex}")
484
508
509
+ def is_selected(self, element: str) -> bool:
510
+ """
511
+ Gets status of select element
512
+
513
+ Args:
514
+ element (str): element select
515
+
516
+ Returns:
517
+ bool: selected state
518
+
519
+ Raises:
520
+ ActionException: error selecting element
521
+
522
+ Example:
523
+ ```
524
+ main_window.is_selected("wnd[2]/tbar[0]/field[1]")
525
+ ```
526
+ """
527
+ try:
528
+ return self.session_handle.findById(element).selected
529
+
530
+ except Exception as ex:
531
+ raise exceptions.ActionException(f"Error getting status of element {element}: {ex}")
532
+
485
533
def set_checkbox(self, element: str, selected: bool) -> None:
486
534
"""
487
535
Selects checkbox element
@@ -671,6 +719,58 @@ <h3>Methods</h3>
671
719
self.session_handle.findById("wnd[0]").close()</ code > </ pre >
672
720
</ details >
673
721
</ dd >
722
+ < dt id ="pysapscript.window.Window.is_selected "> < code class ="name flex ">
723
+ < span > def < span class ="ident "> is_selected</ span > </ span > (< span > self, element: str) ‑> bool</ span >
724
+ </ code > </ dt >
725
+ < dd >
726
+ < div class ="desc "> < p > Gets status of select element</ p >
727
+ < h2 id ="args "> Args</ h2 >
728
+ < dl >
729
+ < dt > < strong > < code > element</ code > </ strong > : < code > str</ code > </ dt >
730
+ < dd > element select</ dd >
731
+ </ dl >
732
+ < h2 id ="returns "> Returns</ h2 >
733
+ < dl >
734
+ < dt > < code > bool</ code > </ dt >
735
+ < dd > selected state</ dd >
736
+ </ dl >
737
+ < h2 id ="raises "> Raises</ h2 >
738
+ < dl >
739
+ < dt > < code > ActionException</ code > </ dt >
740
+ < dd > error selecting element</ dd >
741
+ </ dl >
742
+ < h2 id ="example "> Example</ h2 >
743
+ < pre > < code > main_window.is_selected("wnd[2]/tbar[0]/field[1]")
744
+ </ code > </ pre > </ div >
745
+ < details class ="source ">
746
+ < summary >
747
+ < span > Expand source code</ span >
748
+ </ summary >
749
+ < pre > < code class ="python "> def is_selected(self, element: str) -> bool:
750
+ """
751
+ Gets status of select element
752
+
753
+ Args:
754
+ element (str): element select
755
+
756
+ Returns:
757
+ bool: selected state
758
+
759
+ Raises:
760
+ ActionException: error selecting element
761
+
762
+ Example:
763
+ ```
764
+ main_window.is_selected("wnd[2]/tbar[0]/field[1]")
765
+ ```
766
+ """
767
+ try:
768
+ return self.session_handle.findById(element).selected
769
+
770
+ except Exception as ex:
771
+ raise exceptions.ActionException(f"Error getting status of element {element}: {ex}")</ code > </ pre >
772
+ </ details >
773
+ </ dd >
674
774
< dt id ="pysapscript.window.Window.maximize "> < code class ="name flex ">
675
775
< span > def < span class ="ident "> maximize</ span > </ span > (< span > self) ‑> None</ span >
676
776
</ code > </ dt >
@@ -1239,6 +1339,7 @@ <h1>Index</h1>
1239
1339
< h4 > < code > < a title ="pysapscript.window.Window " href ="#pysapscript.window.Window "> Window</ a > </ code > </ h4 >
1240
1340
< ul class ="two-column ">
1241
1341
< li > < code > < a title ="pysapscript.window.Window.close_window " href ="#pysapscript.window.Window.close_window "> close_window</ a > </ code > </ li >
1342
+ < li > < code > < a title ="pysapscript.window.Window.is_selected " href ="#pysapscript.window.Window.is_selected "> is_selected</ a > </ code > </ li >
1242
1343
< li > < code > < a title ="pysapscript.window.Window.maximize " href ="#pysapscript.window.Window.maximize "> maximize</ a > </ code > </ li >
1243
1344
< li > < code > < a title ="pysapscript.window.Window.navigate " href ="#pysapscript.window.Window.navigate "> navigate</ a > </ code > </ li >
1244
1345
< li > < code > < a title ="pysapscript.window.Window.press " href ="#pysapscript.window.Window.press "> press</ a > </ code > </ li >
0 commit comments