Selection a value using more criteries

Leszek1

Новичок
Регистрация
11.11.2017
Сообщения
23
Благодарностей
4
Баллы
3
Hello guys, someobody know how to select value from option box, but when iv got two or more criterias for example iv got code like this :"

<option class="kat_gl" value="1_0" disabled="disabled">Buy / Sell</option>
<option value="1_1">Buy </option>
<option value="1_1">Sell </option>
<option value="1_25">Other </option>
<option class="kat_gl" value="4_0" disabled="disabled">Cars</option>
<option value="4_74">Cars </option>
<option value="4_76">Other </option>
<option value="4_75">Bus </option>
<option class="kat_gl" value="2_0" disabled="disabled">Hause</option>
<option value="2_35">Hause sell </option>
<option value="2_36">Hause buy </option>
<option class="kat_gl" value="3_0" disabled="disabled">Work</option>
<option value="3_29">Other</option>
<option value="8_53">Offer</option>

And in variables if got just two values : main category and subcategory. And now when in variables iv got Main category = Cars , and sub = Other , i want just to select this subcategory other in main category Cars , when i use standard set - selecteditems - {Variable} - "Other" they take first match.

For the complex, I can not give a stiff look at which result to click. It needs to work in such a way that it first looks for the main category, then selects the first hit of the sub category

There is other way to make that??
 

Yann

Client
Регистрация
22.04.2017
Сообщения
207
Благодарностей
30
Баллы
28
Maybe you could do it based on the value. When it's a main category, the value ends with "_0" and when it is a subcategory it ends with "_" +number. So if you only want to select a subcategory you can check the value or do a regex that get the item that do not end with "_0"

Hope it helps
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113
First split vartiable into two variables. Main category and subcategory.

Then scrape values for car 4_74 and then scrape also subcategory value 4_76 and then select value in action.
 

Leszek1

Новичок
Регистрация
11.11.2017
Сообщения
23
Благодарностей
4
Баллы
3
The best way would be to do this: first get the page code, then regex to extract the value, this value will certainly be the one that I want, then select in this field after the value.

I have a problem .... in the page code are different value than in the action designer, it looks like the action designer value is not downloaded directly from the code only numbered behind the view order.

Downloading a specific value from the page code does not have the slightest problem, but as now in the template do to select that particular value

Here's example:

<option value="">&nbsp;- Wybierz kategorie - </option>
<option class="mainitem" value="252"> Usługi</option>
<option class="subitem" value="281">inne usługi </option>
<option class="subitem" value="280">zdrowie </option>
<option class="subitem" value="279">wypożyczalnie </option>
<option class="subitem" value="278">utylizacja </option>

upload_2017-11-27_14-45-29.png


And look here is everything ok :-), and now i want to choose that category with value =280 , what i have to do ? just set value -> 280 ? , thats not working
upload_2017-11-27_14-49-12.png


And unfortunately, but is not able to choose this value, maybe it should do it in another way ?? , i can't use selecteditems with clear name of subcategory.

I will be grateful for the helpful information
 

Leszek1

Новичок
Регистрация
11.11.2017
Сообщения
23
Благодарностей
4
Баллы
3
I think when i use set->value i just change that value in code , not choose that from list , but for using "selecteditem" i can use just a clear name :( , any way to select items using his value ?
 

LightWood

Moderator
Регистрация
04.11.2010
Сообщения
2 382
Благодарностей
915
Баллы
113

Leszek1

Новичок
Регистрация
11.11.2017
Сообщения
23
Благодарностей
4
Баллы
3
I can not, in this selecteditems field, two values can be the same, for me the choice will depend on the main category, but using selecteditems, entering this value he will find two equivalents and use the first one.

Another thing, I can not declare earlier, for example, to choose the 2nd value.

Now I do it in such a way that I retrieve the innertext value from the field, then I process it with regex, create tables, number all values and using regex search for a specific value, and use it using value, but this is expensive, there is no other way ?

The point is how in the box with the categories I have 2 the same ex values (car), but before them is the text ex (Diesel) and (Electric), how to do now to choose a specific one in which the main category is. ...
 

Leszek1

Новичок
Регистрация
11.11.2017
Сообщения
23
Благодарностей
4
Баллы
3
simple matter, does anyone have knowledge how to choose, use the value that is assigned to a particular category in html? (because the value which is assigned in html, and later when choosing is different), I want to choose a value using the value assigned to the category in html
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)