Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check if exist not selected radiobutton
#1
Not Solved
Hi,
Im facing this kind of problem. Have in one radiobuttons group list of four radiobuttons.
A, B, C, D. Problem is that any of this product not every time exist (due setting of clients before). Every time when I get to this page with radiobuttons first one is selected.

Problem: I need check if eg. C exist and then select him and continue wizard. THis will continue until all available wizard will be finished. (hope this is clear)

What I have now is
Code:
If Browser("Some").Page("ONE").WebRadioGroup("productType").GetROProperty("value")="A"  Then
Browser("Some").Page("ONE").WebRadioGroup("productType").Select "A"
End if

But if you need check eg if exist B, you will have result false, becouse A is selected so results is A

Eny help, thanks a lot
Reply
#2
Not Solved
Hi,

Use Descriptive Programing and check which radio button is available and proceed accordingly.

Regards,
Sankalp
Reply
#3
Not Solved
Oh, thanks, dont even have any idea that exist. Can you give me little example how should i start with code thx
Reply
#4
Not Solved
Hi,

USe below code:


Code:
Function createDescription(vs_micClass,vs_Text)

  
   'Variable Declaration:
   Dim vo_ResDesc
  

  

   'Code:
   Set vo_ResDesc=Description.Create()
   vo_ResDesc("micclass").value=vs_micClass
   vo_ResDesc("text").Value=vs_Text
   vo_ResDesc("text").regularexpression=False
   Set createDescription=vo_ResDesc
  

  
End Function

Set vo_ResDesc=createDescription("Link",<name>)

Set vo_ResLink=Browser("").Page("").ChildObjects(vo_ResDesc)
If vo_ResLink.Count<>0 Then
    Reporter.ReportEvent micDone ,"Existence of XX","YY"
    vo_ResLink(0).Click
    else
    Reporter.ReportEvent micFail ,"Existence of responsibilty","YY"
    ExitTest
End If


Use the above code for refrence and modify it as per your need.

Regards,
Sankalp
Reply
#5
Not Solved
Thanks a lot, I copy paste and after function definition have sintax error:
Code:
Set vo_ResDesc=createDescription("Link",<name>)
should i change in here something?

thanks a lot
Reply
#6
Not Solved
Yes, Instead of link pass the class name for radio button and under name pass the name of radio button u want to identify.

Regards,
Sankalp
Reply
#7
Not Solved
Hi again,
I debug script but as a result have all the time 0, dont know whats wrong. Can you please add comment to the code (each line) what is it doing? Maybe if I will understand that code what you create, will be able do more.
cheers
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Exist and Visible Are True When Objects Aren't There - Is there A Better Way? zunebuggy 3 3,131 04-24-2018, 02:12 PM
Last Post: Ankur
  Time Delay issue with Exist mv8167 11 24,785 06-19-2017, 02:56 PM
Last Post: grosorg
  DataGrid: double click on selected row robertosalemi 0 4,428 05-12-2016, 03:00 PM
Last Post: robertosalemi
  Performance Issues Using '.Exist' AndyBSG 2 3,480 12-12-2014, 03:24 PM
Last Post: AndyBSG
  datatable column exist diya 3 12,532 12-11-2012, 11:24 AM
Last Post: elango87

Forum Jump:


Users browsing this thread: 2 Guest(s)